
03-25-2005, 06:13 AM
|
|
Newcomer
|
|
Join Date: Jan 2004
Posts: 7
|
|
Socket objectDisposedException
|
Hi, in my program I've 2 threads, 1 to handle socket connections and other to do background processing. The problems is that when I close a socket in the background thread (thread 2), then thread 1 throws the System.ObjectDisposedException for the socket in ReadCallBack procedure.
I've made a handler to catch the execption, but I want to know if there is a better way to avoid this exception? Why closing the socket in another thread causes this exception, I'm using SocketShutdown.Both before Close?
Thanks in advance
|
|