send structure through socket?
C#
3
Posts
3
Posters
0
Views
1
Watching
-
How i can convert user define structure into byte array,or tell me how can i send struct through socket?
Use Binary Serilazation. The only trick here is that the "other side" needs to know the class\struct structure (both must use the same dll describing the class\struct). there is a good example on the MSDN help. Gilad.
-
How i can convert user define structure into byte array,or tell me how can i send struct through socket?
Make your structures as Serializable. [Serializable] struct Person { public string name; public int age; }; Use binary serialization/deserialization to convert your structures to byte array and vise versa DevIntelligence.com - My blog for .Net Developers