EAGAIN error in connect()

Hi All,

What does an EAGAIN (11) error code mean after a connect() call? The reason
I ask is that it is not listed as one of the error codes that connect()
returns in the help files. I am working on a socket server and out of 10000
attempted connections, several of them fail in the connect with errno being
set to 11. Another interesting tidbit is that the first failure happens
around number 3976 every time. I have no idea why this is happening since
I’m only opening one socket connection at a time. I am preforking in my
socket server to handle the connections, ie I am forking 5 children and each
one of the children runs accept(). Do you think this might have something
to do with it?

Any ideas why this happens? Any help would be appreciated.

Thanks,

Jim

One other bit of information is that when a connect does fail, the system
becomes unbearably slow and practically unusable, ie. no/slow mouse
response.

Jim

“Jim Lambert” <jlambert@futurex.com> wrote in message
news:9uripj$b6v$1@inn.qnx.com

Hi All,

What does an EAGAIN (11) error code mean after a connect() call? The
reason
I ask is that it is not listed as one of the error codes that connect()
returns in the help files. I am working on a socket server and out of
10000
attempted connections, several of them fail in the connect with errno
being
set to 11. Another interesting tidbit is that the first failure happens
around number 3976 every time. I have no idea why this is happening
since
I’m only opening one socket connection at a time. I am preforking in my
socket server to handle the connections, ie I am forking 5 children and
each
one of the children runs accept(). Do you think this might have something
to do with it?

Any ideas why this happens? Any help would be appreciated.

Thanks,

Jim

It’s failing while doing an implicit bind() and assigning
the ephemeral port. ephemeral ports are in the range
1024 → 5000 (3976 slots). If the destination port, addr
pair are changing, you should be able to specify the
SO_REUSEADDR socket (setsockopt()) option before the
connect(). If they are not, you’ve run out of unique
socket pairs (dest ip, dest port, local ip, local port) in
the local ephemeral range and will have to bind() a higher
local port number before the connect().

-seanb

Jim Lambert <jlambert@futurex.com> wrote:
: Hi All,

: What does an EAGAIN (11) error code mean after a connect() call? The reason
: I ask is that it is not listed as one of the error codes that connect()
: returns in the help files. I am working on a socket server and out of 10000
: attempted connections, several of them fail in the connect with errno being
: set to 11. Another interesting tidbit is that the first failure happens
: around number 3976 every time. I have no idea why this is happening since
: I’m only opening one socket connection at a time. I am preforking in my
: socket server to handle the connections, ie I am forking 5 children and each
: one of the children runs accept(). Do you think this might have something
: to do with it?

: Any ideas why this happens? Any help would be appreciated.

: Thanks,

: Jim