Socket objectDisposedException

CaptinPlanet
03-25-2005, 06:13 AM
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

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum