On Tue, Apr 24, 2012 at 6:29 PM, levin li <levin108 at gmail.com> wrote: > Yes, we met this problem, when read() returns zero, but errno is EAGAIN, > I suppose the EAGAIN was created by previous read() What I meant is that the connection is closed when read() returns zero, so we don't need to check the connection state with getsockopt(). I think your patch is correct. Thanks, Kazutaka |