>yenjet wrote:
>
>> I'm wondering what is the fastest way to close a network port instead what
>> I'm doing is to reboot the machine?
>>
>> Recently, I have kill up a process which is running half way. And I get
>> "port already opened" error when I tried to start the same process again.
>> And I'm sure the process and all the child process alrady been killed. Is
>> there anyway for me to close the network port without reboot the machine ?
If you set the socket option SO_REUSEADDR, you can reopen a socket that is stuck
in TIME_WAIT. There are a few things that you should know about doing that,
namely with regard to stale packets destined for the old process that make it
instead to the new process. "UNIX Network Programming" by W. Richard Stevens
(ISBN 0-13-490012-X) has some excellent information about this, and pretty much
everything else you need to know about socket programming.
Check the man pages for getsockopt(2) and setsockopt(2).
-----------------------------------------------------------------------------
Edward C. Lange [EMAIL PROTECTED]
"And you, madam, are ugly. But I shall be sober in the morning."
-- Sir Winston Churchill, in response to Bessie Braddock, who told him
he was drunk
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]