Juergen Suessmaier juergen at
Mon Jun 18 17:03:21 UTC 2001

>   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,
J. Süßmaier Systementwicklungen
Jürgen Süßmaier
juergen at                       Realtime Software Development
Katharina Geisler Str. 14                       Embedded Applications
D-85356 Freising                                     Automation
      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 with the following body:
unsubscribe »your-email-address«

More information about the KDevelop mailing list