.net - C# -- TcpListener.Start() causing SocketException with message "Only one usage of each socket address" -


i have service it's coming invokes start() method on tcplistener instance. listener using port not common , not known used other services. very span of minute or experiences odd error. minute service (which on failure restarts immediately) back crashes on following exception:

   socketexception    @ system.net.sockets.socket.dobind(system.net.endpoint, system.net.socketaddress)    @ system.net.sockets.socket.bind(system.net.endpoint)    @ system.net.sockets.tcplistener.start(int32)    @ mytestserver.server.startlistening() 

with exception message follows:

only 1 usage of each socket address (protocol/network address/port) permitted 

this article suggests i'm experience port exhaustion , should tweak registry modify timeout , port range values winsock. , well, have (or expect have) 50-100 clients connecting. how possibly run out of ports? bots , port scanners?

it isn't port exhaustion in post. connecting out wcf (which tcpclient). binding tcp port , waiting connection. isn't strictly same thing. binding specific tcp port number. when message, windows (correctly or not) thinks in use. windows reporting process bound port, can't. can have 2 processes trying use port , problem, 50-100 figure isn't issue.

either causing problem somewhere else or there other application causing problem.

if service experiencing problem , dies without ever calling tcplistener.stop(), service restarts itself, won't able bind port because windows may not know process done it.

you'll have post more details further.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -