Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!uunet!mcvax!ukc!stl!stc!datlog!scm From: scm@datlog.co.uk ( Steve Mawer ) Newsgroups: comp.unix.questions Subject: Socket help wanted Message-ID: <2145@dlvax2.datlog.co.uk> Date: 18 Jul 89 13:31:27 GMT Organization: Data Logic Ltd, Queens House, Greenhill Way, Harrow, London. Lines: 41 I have a problem with BSD sockets, which I hope someone on the net can give me assistance with. I have an application which listens on a well-known port, accepts a connection and execs a child process, then awaits further connects. When a predetermined number of connections has been made, my program has to stop listening until one or more of its children terminates, freeing connection capacity for more connections. This is to allow potential connectees to try other machines for a connection when capacity on one machine is reached. With the listen pending, the connection happens even when I'm not doing an accept, hanging up the connecting process (although other connects will fail due to the listen queue being full). The program has to run in a number of environments, including Ultrix and AIX. The Excelan implementation is no problem, due to the way in which they've done the socket interface (which is a pain in other ways). My problem is - how can I stop the outstanding listen? I've RTFMd but can find no relevant information. My documentation describes fully how make sockets and get connections, but not how to suspend them in a temporary manner. I've tried closing the listening socket, but I then can't re-open it due to EADDRINUSE errors. I've tried to setsockopt to SO_ACCEPTCONN 'off', but that seems to have no effect (on AIX, BTW). Shutdown seems interesting, but there doesn't seem to be a corresponding openup call to restart the shutdown part, it also seems to me that it only stops 'sends' and/or 'receives', not 'reads' and/or 'writes'(?). Is what I'm attempting impossible, or am I just missing the obvious? Please e-mail, and I'll summarise to the net. - Steve C. Mawer or < {backbone}!ukc!datlog!scm > Voice: +44 1 863 0383 (x2153) -- Steve C. Mawer or < {backbone}!ukc!datlog!scm > Voice: +44 1 863 0383 (x2153)