Re: Nonblocking socket
- From: Vishwas Pai <noman@xxxxxxxxxxxxxx>
- Date: Mon, 12 Jun 2006 06:46:22 GMT
Henrik Goldman wrote:
Hi,
Following the documentation on hp-ux I set my socket as non-blocking:
int nFlags;
nFlags = fcntl(ListenSocket, F_GETFL, 0);
nFlags |= O_NONBLOCK;
if (fcntl(ListenSocket, F_SETFL, nFlags) == -1)
return false;
This actually to work fine but what I don't understand is that accept() returns errno 2 (ENOENT) instead of EAGAIN or EWOULDBLOCK like the documentation says.
Can anyone shed some light on this?
The error code that I get is not even mentioned in the manpage for accept.
Which protocol family ? Socket is just a entry point for
several protocol families, so a bug in the accept entry
routine of the specific PF could cause the system call
accept() to return an unexpected error.
Following is just my guess - if you are using PF which
does not support NONBLOCKing sockets, then it might
return ENOENT (which in practice should return ENOTSUP).
Does the accept work okay with a blocking socket ?
--vishwas
.
- Follow-Ups:
- Re: Nonblocking socket
- From: Henrik Goldman
- Re: Nonblocking socket
- References:
- Nonblocking socket
- From: Henrik Goldman
- Nonblocking socket
- Prev by Date: Re: Hiding symbols in shared library
- Next by Date: Re: Nonblocking socket
- Previous by thread: Nonblocking socket
- Next by thread: Re: Nonblocking socket
- Index(es):
Relevant Pages
|