Subject: Re: O_NONBLOCK

Re: O_NONBLOCK

From: William Ahern <william_at_25thandclement.com>
Date: 2005-05-17

On Tue, May 17, 2005 at 01:56:22PM -0400, codemastr wrote:
>
> ----- 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?
>

I should've SIGKILL'd the process to get a core or attached with gdb. Of
course, I didn't :( I was just using strace and anxious to get e-mail
flowing again.

However, I'm using an ancient version of ares in which only
read_udp_packets() uses recv(2).

_______________________________________________
http://cool.haxx.se/mailman/listinfo/c-ares
Received on Tue May 17 20:11:12 2005