Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

stream does not support concurrent IO read or write operations

I'm using a network stream to read data from network in an ASP.NET application 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 ?

like image 787
Xaqron Avatar asked Dec 29 '10 12:12

Xaqron


1 Answers

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.

like image 184
Marc Gravell Avatar answered Oct 02 '22 03:10

Marc Gravell