Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!sunybcs!ugoday From: ugoday@sunybcs.uucp (Abdi Oday) Newsgroups: comp.unix.questions Subject: Re: Socket question Message-ID: <4482@cs.Buffalo.EDU> Date: 3 Mar 89 23:34:07 GMT References: <1006@blake.acs.washington.edu> Sender: nobody@cs.Buffalo.EDU Reply-To: ugoday@sunybcs.UUCP (Abdi Oday) Distribution: usa Organization: SUNY/Buffalo Computer Science Lines: 43 In article <1006@blake.acs.washington.edu> icsu6000@caesar.cs.montana.edu (Jaye Mathisen) writes: > > >Everything works fine, except when I'm all done, or I get an error >condition, I just want to blow the whole thing away and restart. What I have >so far is: > > All the socket set up stuff > execute garbage, return answer > If error then > shutdown(socket,(int)2); > close(socket) > > execve(argv[0],argv,envp); > >The execve executes, but the program bombs on the bind() call with >an "address already in use" message. How do I get this "address" >released so I can restart it. Or is execve the wrong call?? > >Jaye Mathisen >icsu6000@caesar.cs.montana.edu I think what you want to do is queue thinks up on your socket. In other words, on the "listen" call, you tell it how many calls to queue up. example: listen(socket, 10) will queue up 10 requests. Otherwise after you close connection, it takes a while (sometimes 2 minutes ... I don't understand why) for a bind to work. Hope that helps -Abdi Abdi Oday Phone: (716) 636-3004 University at Buffalo BITNET: ugoday@sunybcs.BITNET Internet: ugoday@cs.Buffalo.EDU UUCP: ...!{ames,boulder,decvax,rutgers}!sunybcs!ugoday