:--Boundary_(ID_mQ1p0DshiB00ke/hmU0cHA)
:Content-type: text/plain; charset=us-ascii
:Content-transfer-encoding: 7BIT
:
:When an app binds an address and port to a listen socket,  what
:variables
:can I adjust so the address may be reused immediately after the app
:exits.
:My understanding  was that
:int on = 1;
:setsockopt(s,SOL_SOCKET,SO_REUSEADDR,&on,sizeof(on));
:would do it but there still seems to be a significant amount of time
:between
:the exit and bind allowing a new app to use the address, even though
:there
:are no inbound connections pending in the listen queue when the exit
:occurs.
:I am debugging a server and the process requires restarting often.
:
:Thanks,
:Rick

    SO_REUSEADDR is the correct socket opt and it will allow the address
    to be reused immediately.  If you still get 'address already in use'
    then there is still another process listening on the socket...
    probably an older named that you missed, or perhaps the other named
    simply wasn't exiting quickly enough before you started the new one.

                                        -Matt

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to