Port occupation/release of remote server in. Net remoting

Source: Internet
Author: User

This problem usually occurs in Console Application/Windows Service Bearer Remote objects Required Remote Server Specify a specific Port . IIS In the bearer Remote objects You do not need to specify a specific Port Therefore Socketexception Exception information.

 

1. Start bearer Remote objects Of Console Application To find the specified Port Status: Listening .

Apparently Remote Server Start listening to this Port , Acceptable Client .

 

2. Disable the bearer Remote objects Of Console Application The specified Port Status: Time_wait .

 

If you startConsole ApplicationWill throw the following exception:

An unhandled exception of Type 'System. runtime. remoting. remotingexception' occurred in mscorlib. dll

 

Additional information: remoting configuration failed with the exception system. reflection. targetinvocationexception: exception has been thrown by the target of an invocation. ---> system. net. sockets. socketexception: Only one usage of each socket address (Protocol/network address/port)

Is normally permitted

 

SocketexceptionException: EverySocket address (Protocol/network address/port)Only one application can be used.

 

3.Personal Opinion

About Time_wait Status, which is Windows The system is designed to prevent connections from the old ( Old connection ). Packets Interfere with new connections ( New Connection ). Therefore, the system will wait by default. 4 Minutes, let those remaining Packets Discard.

 

Therefore, do not try to solve this problem. Wait 4 Minutes or so. Port Confirm release and start again Remote Server , Such Console Application/Windows Service .

 

Comments or comments. Thank you.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.