[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pine-info
Subject:    Re: ALERT: Solaris 2.5.1 locks up on TCP connections in Pine 3.9x
From:       borchert () turing ! mathematik ! uni-ulm ! de (Andreas Borchert)
Date:       1996-11-29 15:00:03
[Download RAW message or body]

On 26 Nov 1996 10:24:07 +0100, Casper H.S. Dik <casper@fwi.uva.nl> wrote:
> Mark Crispin <mrc@CAC.Washington.EDU> writes:
> 
> >2) The 0 byte read serves a purpose.  On all systems except Solaris, it
> >   enables Pine to report a TCP/IP connection failure after doing a
> >   blocking select().  Otherwise, a failure to open the connection will
> >   not be detected until Pine tries to read data from the connection, and
> >   it will report the wrong message.
> 
> It still is bad programming; the proper way to do a non-blocking connect is
> to retry the connect you eitehr get an already connected error or
> a timeout.

There may be several ways to setup asynchronous connects but probably
it is best to use the method that is suggested by the associated
man pages -- in this case getsockopt(3N):

     SO_ERROR returns any pending error on the socket and clears the
     error status.  It may  be used  to check for asynchronous errors
     on connected datagram sockets or for other asynchronous errors.

This should work on all platforms which support BSD sockets.

Andreas.

-- 
Andreas Borchert, Universitaet Ulm, SAI, Helmholtzstr. 18, 89069 Ulm,  Germany
E-Mail: borchert@mathematik.uni-ulm.de
WWW:	http://www.mathematik.uni-ulm.de/sai/borchert/
PGP key available via ``finger borchert@laborix.mathematik.uni-ulm.de''

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic