Groups | Blog | Home
all groups > dotnet faqs > april 2005 >

dotnet faqs : .net remoting and tcp listener socket



Danish Ahmed
4/20/2005 7:43:54 AM
Hi,

I am using .net remoting with tcp channel and a tcp socket for accepting
connections in a console application. When I run the application first time
everything works fine but if I run the application again I get only one
usage of socket address exception when 'bind' of listener socket is called.
This only occurs if a client is connected to application in the previous
run. Remoting and socket are using different ports, I have also make sure
that socket is closed and tcp channel is unregistered on application
shutdown. Any ideas why listening port remains open ?, I am using .net
framework 1.1.

Regards

Danish Ahmed



Ivan Zuzak
4/21/2005 12:00:00 AM
[quoted text, click to view]

hi,
the OS doesnt release the socket from that IP:PORT right after you close
the application. it takes some time (a minute or two).

so, look at the Channel and Formatter Configuration Properties in the
MSDN, and find the "exclusiveAddressUse" property. this will solve your
Danish Ahmed
4/21/2005 4:02:24 AM
Thanks for the reply Ivan, I set the 'exclusiveAddressUse' for both tcp
channel and listener socket but the problem is still occurring, one thing I
have notice is that this problem only occurs if some client connects to
listener socket also if I remove to remoting code from the application
listener socket starts working perfectly.



Regards

Danish Ahmed

AddThis Social Bookmark Button