Subject: Re: O_NONBLOCK

Re: O_NONBLOCK

From: codemastr <codemstr_at_ptd.net>
Date: 2005-05-17

----- Original Message -----
From: "William Ahern" <william@25thandClement.com>
To: <c-ares@cool.haxx.se>
Sent: Tuesday, May 17, 2005 1:18 PM
Subject: O_NONBLOCK

> Has anyone run into trouble with a blocking read? I woke up this morning
> to
> find a test server blocked on a recv(2) call. The _only_ recv(2) I can
> find
> in my code is from Ares, and I now realize that Ares doesn't set any of
> it's
> sockets non-blocking.
>
> Can anyone think of any issues that might arise if I made the sockets
> non-blocking and dealt with errno=EAGAIN/EWOULDBLOCK in read_udp_packets()
> and read_tcp_packets()? I can't think of any off-hand.

Well open_tcp_socket does set O_NONBLOCK. However, it does not seem that the
open_udp_socket does. From your tracing, are you able to see whether the
socket that blocked was TCP or UDP?

Dominick Meglio

_______________________________________________
http://cool.haxx.se/mailman/listinfo/c-ares
Received on Tue May 17 19:55:57 2005