[4] in Pthreads mailing list archive
Re: timed reads
daemon@ATHENA.MIT.EDU (Greg Hudson)
Fri Jun 9 13:00:39 1995
To: Bill Sommerfeld <sommerfeld@orchard.medford.ma.us>
Cc: Rich Salz <rsalz@osf.org>, pthreads@MIT.EDU
In-Reply-To: Your message of "Fri, 09 Jun 1995 11:30:09 EDT."
<199506091530.PAA00661@orchard.medford.ma.us>
Date: Fri, 09 Jun 1995 11:52:24 EDT
From: Greg Hudson <ghudson@MIT.EDU>
> Short of using select() or the non-standard timedread(), the
> cleanest way to code something like this may well be to have the
> timer thread simply close() the descriptors in question [...]
> I have no idea what would happen in Chris Provenzano's
> implementation..
I believe the close() will block on the read(). You can call
shutdown(sock, 1) to shut down further sends, which will send a TCP
close packet and cause the other side to close the connection and
terminate the read()... but not if the other side has disappeared off
the net.