XmlSerializer.Deserialize blocks over NetworkStream

后端 未结 1 867
小蘑菇
小蘑菇 2021-01-14 01:44

I\'m trying to sends XML serializable objects over a network stream.

I\'ve already used this on an UDP broadcast server, where it receive UDP messages from the local

相关标签:
1条回答
  • 2021-01-14 02:21

    Of course because the serializer continue to read the NetworkStream, and it doesn't ends when encouter the main end element.

    To achieve the wanted result it's necessary the use of a MemoryStream, which notify the end of stream when the last byte was read.

    0 讨论(0)
提交回复
热议问题