C# - TcpClient - Detecting end of stream?

后端 未结 2 1322
挽巷
挽巷 2020-12-17 22:49

I am trying to interface an ancient network camera to my computer and I am stuck at a very fundamental problem -- detecting the end of stream.

I am using TcpCl

2条回答
  •  一向
    一向 (楼主)
    2020-12-17 23:35

    Well you can't exactly says EOS on a network communication ( unless the other party drop the connection ) usually the protocol itself contains something to signal that the message is complete ( sometimes a new line, for example ). So you read the stream and feed a buffer, and you extract complete message by applying these strategies.

提交回复
热议问题