Re: Why passing socket objects over execution

lance@fox.com
Mon, 8 Aug 94 9:21:58 PDT

> From: "I-feng Kao - EECS (CPTS317)" <ikao@gandalf.eecs.wsu.edu>
> Date: Thu, 4 Aug 1994 21:31:12 GMT
>
> s = socket (AF_INET, SOCK_STREAM, 0)
> s.bind ((222.222.222.222, 1040))
> s.listen (1)
> ^^^^^^^^^^^^^^^^^^^^^^Program stops here.
>
> read, write, exc = select ([s.fileno()],[],[], timeout)
> if s.fileno() in read:
> news = s.accept ()
> s.close()
>
>
> This is similar to what I am using right now,
> The problem is the program stops
> at listening until having a connection. Rest of the program will not be
> executed until a connection comes in. So I can either doing idle detection
> with some timer which sends out signal or having connection before forking
> a child and passing the socket object to the new program that child executes.

If your program stops at the listen() call, then your TCP/IP layer is
BROKEN! It should NOT block here. All the listen does is initialize a variable
and set a flag.
TCP/IP is susposed to block on the accept() call not the listen() call..

--
Lance Ellinghouse                lance@fox.com