Re: select() indicates writability before a non-blocking TCP socket has actually connected
- From: Grant Edwards <grante@xxxxxxxx>
- Date: Thu, 26 Oct 2006 14:22:08 -0000
On 2006-10-26, jaswantv@xxxxxxxxxxxxxxxxxx <jaswantv@xxxxxxxxxxxxxxxxxx> wrote:
I am trying to implement a TCP client which can wait until it has a
server to connect to. The idea is that the client will emit periodic
notifications while the server is unavailable. I have used non-blocking
sockets and select() to implement the behaviour where each call to
select() will return if either the connection is made (server starts up
and begins accepting connections) or the timeout expires. If a timeout
occurs, the socket is closed and a new socket along with a new call to
connect() is done.
I have noticed that on Linux select() returns instantly with the
correct FD bit set (indicating the socket is available for writing).
No, it's indicating that a write() call will not block. Which
is true, because it's a non-blocking socket. Using select on a
non-blocking socket doesn't make any sense.
--
Grant Edwards grante Yow! Are you still an
at ALCOHOLIC?
visi.com
.
- Follow-Ups:
- Re: select() indicates writability before a non-blocking TCP socket has actually connected
- From: Phil Frisbie, Jr.
- Re: select() indicates writability before a non-blocking TCP socket has actually connected
- References:
- Prev by Date: Re: what is the purpose of C++ smart pointer
- Next by Date: Problems with shutting down server on Red Hat reboot
- Previous by thread: select() indicates writability before a non-blocking TCP socket has actually connected
- Next by thread: Re: select() indicates writability before a non-blocking TCP socket has actually connected
- Index(es):
Relevant Pages
|