C# Why doesn't “Flush” force the bytes down the network stream?

前端 未结 4 764
我在风中等你
我在风中等你 2021-01-12 00:04

I have a project where I\'m trying to send a serialized object to the server, then wait for an "OK" or "ERROR" message to come back.

I seem to be

4条回答
  •  孤独总比滥情好
    2021-01-12 00:50

    you should use a StreamWriter/Reader linked to your network stream, .Flush does nothing on a NetworkStream, see here:

    http://www.c-sharpcorner.com/UploadFile/dottys/SocketProgDTRP11222005023030AM/SocketProgDTRP.aspx

提交回复
热议问题