Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!hsdndev!husc6!encore!houligan!epeterso From: epeterso@houligan.encore.com (Eric Peterson) Newsgroups: comp.unix.programmer Subject: Problem with binding of socket addresses Message-ID: Date: 3 Dec 90 20:54:01 GMT Sender: news@Encore.COM Reply-To: epeterson@encore.com (Eric Peterson) Organization: Encore Computer Corporation, Diagnostic Development Lines: 34 News-Software: NN 6.4.12 I've encountered some odd behavior in trying to set up a simple client-server system via sockets. It appears to be that Internet bindings are not readily reusable. Here's a quick description of what's going on ... I'll start up the server process which creates a socket, binds itself to an Internet address, then listens for incoming connections. I'll then start up the client which connects to the server. Once the connection is established, the client closes its socket and dies. The server sees the disconnection and closes its acceptor socket. I can then restart the server to wait for new connections. However, the server occasionally hits a bug and core dumps or dies off in some other way. But it dies off and closes its end of the connection before the client closes the other end. When this occurs and I attempt to restart the server, the bind() call fails with the error "Address already in use". Now, neither the client nor the server is running at the time I try to restart the server, and there isn't a problem with address collisions with another process. As far as I can tell, nothing else is using this address. So why does bind() fail? I've seen this occur on several different flavors of Unix, from SunOS to Ultrix to System V variants with BSD extensions. Anyone know why this happens? And is there any way to prevent this behavior? Thanks in advance. Eric -- Eric Peterson <> epeterson@encore.com <> uunet!encore!epeterson Encore Computer Corp. * Ft. Lauderdale, Florida * (305) 587-2900 x 5208 Why did Constantinople get the works? Gung'f abobql'f ohfvarff ohg gur Ghexf.