C# - StreamReader.ReadLine does not work properly!

前端 未结 4 1151
南方客
南方客 2020-12-09 19:37

Simply I have been trying to implement what BufferedStreamReader does in Java. I have a socket stream open and just want to read it in a line-oriented fashion -

4条回答
  •  眼角桃花
    2020-12-09 20:29

    The while in your server code is setup to only read one line per connection. You'll need another while within the try to read all of the lines being sent. I think once that stream is setup on the client side, it is going to send all of the data. Then on the server side, your stream is effectively only reading one line from that particular stream.

提交回复
热议问题