[Devel] tcp keepalive question

Dan Pascu dan at ag-projects.com
Tue Dec 19 14:33:18 CET 2006


On Tuesday 19 December 2006 15:03, Klaus Darilion wrote:
> > dan,
> >
> > how does this differ from the case where UDP UAS is down and does not
> > respond and openser tm module keep re-sending the request until
> > timeout occurs?
>
> I guess the UDP retransmissions are not sent by the worker threads, but
> by a timer thread? And UDP sending is non-blocking.

Klaus, 

Juha is right. I was thinking of a different case where the reply was 
expected right after the request, which is not the case with openser.
TCP connections can be set non blocking as well (I think they are already 
set that way but I'm not sure).

>
> With TCP, if a new connection is needed, the TCP connection will be set
> up by the worker thread. Thus, a new TCP connection can block all
> workers (just as a TLS handshake or DNS lookup)

Making a new TCP connection can indeed block, but not all the workers, 
only the one making the connection.
However you can establish a new connection in non blocking mode, but you 
need a select/poll event loop to notify you when the connection was 
actually established. I'm not sure how openser handles making new TCP 
connections (blocking or not), and depending how it does it it may indeed 
be a blocking point. Writing to existing TCP connections however 
shouldn't be an issue because it does not expect the reply right away.

-- 
Dan



More information about the Devel mailing list