bind

Juergen Suessmaier juergen at suessmaier.de
Mon Jun 18 18:03:21 BST 2001


Hi
>   I'm writing a pop3 server (for fun and to learn network programming), however, I have one problem that is bugging me.
> Whenever I ctrl-c the program or shut it down gracefully (I'm also using a client issued command that issues a shutdown
> on the server side, just for testing purposes), and try to start it back up right away I get the message:
> bind failed: Address already in use (I'm catching the error w/ perror("bind failed"); ) The signal's are handled
> w/ a piece of code that closes all open client connections and then closes the server socket fd as well.
> 
> Any suggestions? Is this something I can fix?

setsockopt ( fd, SOL_SOCKET, SO_REUSEADDR, ... );

see also "man setsockopt" :-)

Have fun,
Juergen
-- 
-------------------------------------------------------------------------
J. Süßmaier Systementwicklungen
Jürgen Süßmaier
juergen at suessmaier.de                       Realtime Software Development
Katharina Geisler Str. 14                       Embedded Applications
D-85356 Freising                                     Automation
Germany
-------------------------------------------------------------------------
                      http://www.suessmaier.de
-------------------------------------------------------------------------
      The day Microsoft makes something that doesn't suck is
        probably the day they start making vacuum cleaners
-------------------------------------------------------------------------

-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list