Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Nov 1996 13:54:54 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        carson@lehman.com
Cc:        terry@lambert.org, stesin@gu.net, hackers@freebsd.org, squid-users@nlanr.net, basch@lehman.com
Subject:   Re: Programming technique for non-forking servers?
Message-ID:  <199611132054.NAA22868@phaeton.artisoft.com>
In-Reply-To: <199611132028.PAA18081@dragon.lehman.com> from "carson@lehman.com" at Nov 13, 96 03:28:39 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> 3) getpeername()
> 
> Works everywhere, but looses the connect error...
> 
> Oh, and don't forget that sometimes connect() will return immediately, even
> if the socket is non-blocking, so you have to check for all possible states
> (success, non-blocking, or error). And be carefull, connect() can return
> different values for non-blocking on different OS's (EINPROGRESS,
> EWOULDBLOCK, etc.)

If you are running a server, then the event *must* be that the data
*is* available.

Therefore you should *always* use blocking sockets.

I think the async connect is not an issue, since as a server, all
connections are *inbound*, not outbound.  You use "accept", not
"connect".


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611132054.NAA22868>