C# send structure objects through socket

前端 未结 6 1739
自闭症患者
自闭症患者 2020-12-09 22:18

i have done a bit of reading in client/server programming in c#. i am familiar enough with this process to ask the following question:

how do i transmit structure ob

6条回答
  •  -上瘾入骨i
    2020-12-09 23:18

    .NET's binary serialization would probably be the fastest out-of-the-box option, assuming both sides of the communication mechanism are C# and can load the same assembly, containing the message types. Rolling your own serialization is probably just fine though, if your structures are very simple. Just define your data structure in a class and also a method to convert it to and from a string.

提交回复
热议问题