NetworkStream doesn't support seek operations

前端 未结 4 510
鱼传尺愫
鱼传尺愫 2021-01-24 02:21

I\'m creating simple proxy server but I faced a strange situation, I\'ve following code :

var clientRequestStream = _tcpClient.GetStream();
var requestHeader = c         


        
4条回答
  •  礼貌的吻别
    2021-01-24 02:54

    As you've discovered, NetworkStream is not seekable.
    NetworkStream feeds you data directly from the network.

    You should read the data into a MemoryStream and re-use that.

提交回复
热议问题