Socket question

Abdi Oday ugoday at sunybcs.uucp
Sat Mar 4 09:34:07 AEST 1989


In article <1006 at blake.acs.washington.edu> icsu6000 at 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 at 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 at sunybcs.BITNET
				Internet:  ugoday at cs.Buffalo.EDU
UUCP: ...!{ames,boulder,decvax,rutgers}!sunybcs!ugoday



More information about the Comp.unix.questions mailing list