Hi Kid,
make sure the type in your generic list is serializable. Then do this:
List<yourtype> itemsToSerialize = new List<yourtype>();
itemsToSerialize.Add ( new yourtype() );
itemsToSerialize.Add ( new yourtype() );
Stream stream = new FileStream( @"MyApplicationData.dat", System.IO.FileMode.Create );
IFormatter formatter = new BinaryFormatter();
formatter.Serialize( stream, itemsToSerialize );
stream.Close();
</yourtype></yourtype>
This sample uses a file. But you can easyly adapt it to write to a socket instead. Here is the part that would deserialize List<yourtype> from a file:
Stream stream = new FileStream( @"MyApplicationData.dat", System.IO.FileMode.Open );
IFormatter formatter = new BinaryFormatter();
List<yourtyoe> itemsDeserialized = (List<yourtype>)formatter.Deserialize( stream );
stream.Close();
</yourtype></yourtyoe>
Again this will have to be adapted by you to utilize a socket instead.
Hope this helps!
Cheers
Manfred