Hi,
I'm working with .NET Remoting. I have a problem
unregistering the server channel when I try to reuse it
closing and reopening it in the same application. The
second time I try to get an instance of the same channel
it returns an exception with socket code 10048 (already in
use).
My server code is,
....for openning:
myLocalClass = new TheRemoteClass();
channel = new HttpChannel (8888);
ChannelServices.RegisterChannel(channel);
ObjRef ref1 = RemotingServices.Marshal
(myLocalClass, "ClassURI");
....for closing:
ChannelServices.UnregisterChannel(channel);
channel = null;
GC.Collect (); //desperate attempt
GC.WaitForPendingFinalizers (); //desperate attempt
RemotingServices.Disconnect(myLocalClass);
....so, after calling the closing code I would like to call
again the openning code to restart the connection, but the
SocketException appears at "channel = new HttpChannel
(8888);"
The solution must not be to maintain the channel opened;
no way.
Is there any unknown bug? (I've read about a similar
problem in the Beta version)
Am I doing anything wrong?
Thank you in advance,
Edgar