This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to find out if socket closed?


On Fri, Jul 11, 2003 at 08:19:57PM +0200, Bob Koninckx wrote:

> This is what I use, and what works for me Use select with a
> timeout
> 
> * or, you'll end up with timeout, in which case select returns < 0 and
> errno should be EINTR
> 
> * or, select returns 0 and you have input, easily detected with
> FD_ISSET(filedes, &ibits)
> 
> * or, select returns 0 and you don't have any input in which case the
> remote side closed the connection.
> 
> Hope this helps,

Problem is, I _do_ have input.  But I don't have anywhere to
put it, and I have to leave unread so that TCP flow control
works.

-- 
Grant Edwards
grante@visi.com

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]