开发者

stream does not support concurrent IO read or write operations

开发者 https://www.devze.com 2023-02-01 20:35 出处:网络
I\'m using a network stream to read data from network in an ASP.NET applic开发者_C百科ation and I get this error while trying to read from the stream:

I'm using a network stream to read data from network in an ASP.NET applic开发者_C百科ation and I get this error while trying to read from the stream:

stream does not support concurrent IO read or write operations

It happens sometimes. Any idea ?


It sounds simply as though you are trying to do two different operations on the same stream at the same time from different threads. Adding a lock (Monitor) or Mutex should help synchronise access to the stream.

0

精彩评论

暂无评论...
验证码 换一张
取 消