The only time I've seen accept() return 0 was when there was a prior,
mistaken call to FCLOSE(0) (that would be your $STDIN :-O ) Many strange
and varied symptoms when this is done. Note that this behavior started
with MPE 5.5. Prior to that, fileno 0 was not valid fileno, it is now.
One other thought is to check your MAX TCP CONNECTIONS in NMMGR.
HTH
Keven Miller wrote:
>
> Concluding my limit test, (recap)
> My test program has 2 call sockets (tcp and udp), then 1001
> tcp connected sockets. (SOCKINFO says I have 1003 sockets,
> last socket has filedesc #1013)
>
> When I attempt to make the next tcp connection, my server
> returns from "select" with activity on the tcp call socket. I then
> call "accept" to get the next connection (socket #1004, expected filedesc
> of #1014).
>
> "accept" returns 0 with errno = 0.
> Continuing connections return 1, 2, 3, 4 ...
>
> To continue, now when accept returns 0 to 9, I prompted for and entered
> the sock number I expected.
> accept=0, enter sock=1014,
> 1, 1015,
> etc.
> For accept=9, I was at sock=1023.
> With the next connection, accept returned the expected error 24:
> Too many open files in process.
>
> (Note: Used SOCKINFO to verify sockets and their filedesc numbers)
>
> Appears the accept is wrapping descriptor numbers on the "odd" number 1014.
>
> (Side note: Trying to duplicate a ipctest server like this one, I found that
> I could
> mingle IPC and BSD procedure calls. Started tcp and ucp call sockets with
> IPCCREATE.
> After I received a connection (IPCRECVCN), I could use getpeername to get
> incoming IP address.
> Then tried select, which returned a 1 and errno=50; but accept brought me
> back a connected
> socket.)
>
> > _____________________________________________________________
> > Keven Miller mailto:[log in to unmask] http://www.exegesys.com
> >
> >
> ---------------------------------------------------
> Plan now to attend the
> eXegeSys eRP Users Conference 2001, Oct. 1-4, Downtown SLC.
> Register today by visiting www.exegesys.com/erp2001/welcome.htm
|