流不支持并行IO读取或写入操作 [英] stream does not support concurrent IO read or write operations
本文介绍了流不支持并行IO读取或写入操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用的是网络数据流中读取一个 ASP.NET
应用程序从网络数据,我得到这个错误,而试图从流中读取:
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:
流不支持并发IO读取或写入操作
这有时会发生。你知道吗?
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.
这篇关于流不支持并行IO读取或写入操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文