[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 11:46:28 -0400 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, May 11, 2022 at 10:36:06AM -0500, Neil R. Ormos wrote:
> Although the tread was originally posted to the bug-gawk list, I'm replying
> on the help-gawk list because at the moment, that's where discussion seems
> most appropriate, but maybe the discussion will turn into a feature request
> for true non-blocking I/O or timeouts that apply to more I/O activity than
> reads.
No need for a feature request -- gawk already has support for
non-blocking I/O. But you will need to install the gawk-select
extension library.
Apart from that, the gawk TCP implementation is deficient in at least one
respect -- it doesn't support multiplexing, which could in theory work when
used in conjunction with the select extension. The problem is that gawk has no
notion of a listening socket vs. a connected socket. One creates a TCP server
socket, but once a connection is accepted, the listening socket is closed, and
the gawk handle now refers to the connected socket. The problem is in
io.c:socketopen.
We have discussed in the past possibly patching the TCP implementation to
remedy this flaw, but nobody has invested the time and effort to fix this. We
would need to come up with a separate naming convention for these TCP
multiplexing sockets so as to avoid breaking existing code.
Regards,
Andy