hello
having problem trying to unregister remoting channel (.NET 2.0/XP) - error:
On server side, I created the channel by:Code:System.Net.Sockets.SocketException : Only one usage of each socket address (protocol/network address/port) is normally permitted
Then I try to close and restart channel (as part of application re-initialization rountine - this means process never actually exited and that would be undesirable)Code:TcpChannel oTcpChannel = new TcpChannel(AppContext.DefaultRemotingInterfacePort); ChannelServices.RegisterChannel(oTcpChannel, true); RemotingConfiguration.RegisterWellKnownServiceType(typeof(Util.MyRemoteObj, "TcpRemoteObj", WellKnownObjectMode.Singleton);
I have no clue how to get around this at the moment - I Googled a bit seems like many people are running into this problem but no solution yet. Many suspected OS (or .NET) failed to release socket on UnregisterChannel until application/process exit. But I don't want to exit the app, just want to reinitialize remoting as part of re-init routine.Code:ChannelServices.UnregisterChannel(oChannel); TcpChannel oChTcp = (TcpChannel)oChannel; oChTcp.StopListening(null);
Any suggestion? Many thanks!


Reply With Quote