I am doing Remoting via a Windows Service. The problem I have is this:
When I go to release a new versionof the Service, I first stop the service. Then, I copy the new exe and dependent files to the bin folder and try to retart the service.
I get this error:
55121 not opened.
Error Message:
Only one usage of each socket address
(protocol/network address/port)
is normally permitted, Stack Trace:
at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel.StartListening(Object data) at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel.SetupChannel()
at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel..ctor(Int32 port)
at System.Runtime.Remoting.Channels.Tcp.TcpChannel..ctor(Int32 port)
at SKPIListener.SKPIListenerService.OnStart(String[] args)
in C:\Projects\SKPIListener\SKPIListener\SKPIListenerService.vb:line 128
The Service is stuck in "Starting" state and I can't stop or start it.
This is the only program that uses port 55121 on the server. Why does it think that the port is in use? Stopping the Service before restarting the new service should have cleared out things so the port would not be in use when I go to rerun it.
Rebooting the box is the only way to clear this problem and this is not a practical approach in production.
Any idea why this is happening, how to prevent it, or any other way to corect it?
Thanks
Chad
Spam Catcher - 12 Apr 2006 18:11 GMT
> This is the only program that uses port 55121 on the server. Why does
> it think that the port is in use? Stopping the Service before
[quoted text clipped - 6 lines]
> Any idea why this is happening, how to prevent it, or any other way to
> corect it?
Seems like the old channel is still stuck on the port.
Did you unregister the channel when you shut down?
Are there threads still running that are tying up the port?