send array with socket C# winforms -


how send array socket java 'outputstream'? can u see demos or example serialization ? can send simple text socket client. how can send array, list or class client. want send format list array;

java's outputstream can not want either, can send byte[] c#'s socket classes do.

if want send complex objects must use form of "serializer" let transform objects in byte[] sent out.

a easy use serializer built in .net xmlseralizer, produce string can feed in streamwriter convert string byte[] , write out on socket. other end use reverse process using streamreader.

if not want use intermediate text step not recomend using binaryformatter see on internet, "fragil" , having different levels of .net windows updates installed on both ends can end breaking it. instead recommend using 3rd party binary serializer protobuf-net


Comments