.net remoting and tcp listener socket

D

Danish Ahmed

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
 
I

Ivan Zuzak

Danish said:
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.

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
problem.
 
D

Danish Ahmed

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top