louis04
asked on
is the close method on networkstream thread safe?
Is it thread safe to call the close method of a network stream while the another thread is using the stream and blocked on the read method?
What I am after is the best way to interrupt a read or write that is blocked waiting to receive or send data. I of course need to do this from another thread.
What I am after is the best way to interrupt a read or write that is blocked waiting to receive or send data. I of course need to do this from another thread.
You have ReadTimeout and WriteTimeout, make use of them.
ASKER
setting timeouts is fine for normal operation but I want to be able to shutdown the program at will so I need to interrupt the blocked read or write - does setting ReadTimeout to zero during a blocked read make it return immediately?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.