help-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: network time service, non-blocking & general TCP multiplexing issues


From: Andrew J. Schorr
Subject: Re: network time service, non-blocking & general TCP multiplexing issues
Date: Wed, 11 May 2022 13:30:57 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, May 11, 2022 at 11:07:51AM -0500, Neil R. Ormos wrote:
> In the example program, if a read timeout were set
> for the
> 
>   getline client < server   ,
> 
> would that allow the connect status to be polled without 
> blocking?  Or would the gawk-select extension still be 
> required? 

You're going to need gawk-select in order to set file descriptors to
non-blocking mode using the set_non_blocking() function that it exports. And
realistically speaking, multiplexing TCP socket servers aren't terribly useful
unless you've got access to select or poll, unless you want to fork a
connection for each client. A real TCP server would use select in the main loop
to check for new connections and/or client requests. Of course, if you dislike
the gawk select extension, you could implement your own extension to add these
capabilities.

Regards,
Andy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]