Date: Fri, 25 Apr 2003 00:57:50 -0600 (MDT) From: "M. Warner Losh" <imp@bsdimp.com> To: wgrim@siue.edu Cc: freebsd-hackers@freebsd.org Subject: Re: recv() returning 0 and EINTR on a still connection. Message-ID: <20030425.005750.43494308.imp@bsdimp.com> In-Reply-To: <Pine.SO4.4.05.10304250110450.18123-100000@cougar.isg.siue.edu> References: <20030425031450.G8323-100000@foem.leiden.webweaving.org> <Pine.SO4.4.05.10304250110450.18123-100000@cougar.isg.siue.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
In message: <Pine.SO4.4.05.10304250110450.18123-100000@cougar.isg.siue.edu> William Michael Grim <wgrim@siue.edu> writes: : I think your problem is that n==0 does NOT mean the connection was closed : (at least not with TCP; I haven't really looked into other session : protocols). I know that it does with FreeBSD, at least for read(2). : If n==0, it only means you have stopped receiving data because there is no : more to be received; you can only trust errno if n==-1 or whatever the man : page specifies for your OS (FreeBSD is -1 in this case). FreeBSD returns -1 and EWOULDBLOCK in this case. Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030425.005750.43494308.imp>