Operating System - HP-UX
1833443 Members
3648 Online
110052 Solutions
New Discussion

Re: Releasing port after abnormal termination

 
Mark Graham
Advisor

Releasing port after abnormal termination

We have GUI application on a system with a range of port numbers, assigning one to each user. If the user is abnormally terminated, the port stays active even though the end user is not using it. These ports get filled up with "BOGUS" users. Besides rebooting the system, how can I clear these for other users to use?
No Bucks, No Buck Rogers...
6 REPLIES 6
James R. Ferguson
Acclaimed Contributor

Re: Releasing port after abnormal termination

Mark:

Once this has happened you are usually stuck with the reboot. The problem arises from the server side waiting for the close dialog that is never going to happen.

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: Releasing port after abnormal termination

Mark:

Here is some more information that may help you avoid some of these problems:

http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0xacfe5f260cafd4118fef0090279cd0f9,00.html

http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0xb5e8f841489fd4118fef0090279cd0f9,00.html

Hopefully these will help you! Regards!

...JRF...
Mark Graham
Advisor

Re: Releasing port after abnormal termination

Thanks James! This will get me started looking into the problem in more details and hopefully I will be able to find a solution or change the way we're assigning ports.

BTW, how did you search the forum lists for the answer you provided?
No Bucks, No Buck Rogers...
James R. Ferguson
Acclaimed Contributor

Re: Releasing port after abnormal termination

Mark:

To search the ITRC Forum, click "search" on the left of the page, choose "Community Forums" and apply your keyword(s).

For searching the Technical Knowledge database I generally go to "Maintenance & Support" [on the left] and go to "Search Technical Knowledge Base" from there.

In your specific case, I have a special interest in this problem, since I have had the problem on various Operating System platforms. I remembered recently researching some of the information I've provided you, and so it wasn't too hard for me to search and choose my threads.

Regards, and good luck!

...JRF...
rick jones
Honored Contributor

Re: Releasing port after abnormal termination

using ndd to sever connections is a rather large _kludge_ and is unsupported (heck, iirc it could even crash your box).

as you are likely finding, trying to tie a user (client side) to a specific port number is problematic. SO_REUSEADDR often does not do what one wants as it was intended for the server side and just allows the creation of a listen endpoint.

it would really be best to allow clients to use just about any port number. also, be sure to use something other than port numbers to authenticate clients.

for servers, as will be found, the answer is to set SO_REUSEADDR in the application before tyring to bind() to the well-known port number. this will solve the TIME_WAIT issue on the server side.

shortening TIME_WAIT via ndd is also not really a good idea. TIME_WAIT is there for a purpuse after all - part of th edata integrity heuristics of the protocol.

there is no rest for the wicked yet the virtuous have no pillows
Anthony deRito
Respected Contributor

Re: Releasing port after abnormal termination

the utility lsof is able to list all open files on the system by passing one of several arguments. One such argument is a port number. For example:

lsof -i @www.hp.com:513-515

will list open file using any protocol on ports 513, 514, or 515 of host www.hp.com.

This utility is often one of the most common tools used when trying to find out more about the ports your system is using.


Tony