gawk-diffs
[Top][All Lists]
Advanced

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

[gawk-diffs] [SCM] gawk branch, feature/improve-inet, updated. gawk-4.1.


From: Andrew J. Schorr
Subject: [gawk-diffs] [SCM] gawk branch, feature/improve-inet, updated. gawk-4.1.0-2747-g6490725
Date: Thu, 24 Aug 2017 16:29:24 -0400 (EDT)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, feature/improve-inet has been updated
       via  649072522e4d54ea65e69617b5fd6545423f0009 (commit)
      from  c417632f68977ff7f714b0a4315b7fb271046959 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=649072522e4d54ea65e69617b5fd6545423f0009

commit 649072522e4d54ea65e69617b5fd6545423f0009
Author: Andrew J. Schorr <address@hidden>
Date:   Thu Aug 24 16:29:04 2017 -0400

    Add improve-inet.mbx file of emails explaining what this branch should do.

diff --git a/ChangeLog b/ChangeLog
index 90e429f..e82ca87 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-08-24         Andrew J. Schorr     <address@hidden>
+
+       * improve-inet.mbx: Add mbox file of emails explaining what needs
+       to be done in this branch.
+
 2017-08-23         Arnold D. Robbins     <address@hidden>
 
        * README.git: Minor edits to make build steps clearer.
diff --git a/improve-inet.mbx b/improve-inet.mbx
new file mode 100644
index 0000000..5c9b5e0
--- /dev/null
+++ b/improve-inet.mbx
@@ -0,0 +1,6362 @@
+From address@hidden  Sun Jun 30 17:19:40 2013
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv4.telemetry-investments.com (ti21 [192.168.78.21])
+       by ti119.telemetry-investments.com (Postfix) with ESMTP id F3C66383
+       for <address@hidden>; Sun, 30 Jun 2013 17:19:39 -0400 (EDT)
+Received: by sv4.telemetry-investments.com (Postfix)
+       id E21951CCE; Sun, 30 Jun 2013 17:19:39 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv4.telemetry-investments.com (Postfix) with ESMTP id CC6C41CBB
+       for <address@hidden>; Sun, 30 Jun 2013 17:19:39 -0400 (EDT)
+Received: from localhost ([::1]:57504 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1UtP23-0005F1-CT
+       for address@hidden; Sun, 30 Jun 2013 17:19:39 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:39119)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1UtP1y-0005EA-Nz
+       for address@hidden; Sun, 30 Jun 2013 17:19:38 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1UtP1u-00006i-Dc
+       for address@hidden; Sun, 30 Jun 2013 17:19:34 -0400
+Received: from gw3a.telemetry-investments.com ([38.76.0.51]:50548
+       helo=sv3.telemetry-investments.com)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1UtP1q-000064-BJ; Sun, 30 Jun 2013 17:19:26 -0400
+Received: from ti119.telemetry-investments.com (ti119 [192.168.53.119])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 621041DCB;
+       Sun, 30 Jun 2013 17:19:25 -0400 (EDT)
+Received: by ti119.telemetry-investments.com (Postfix, from userid 300)
+       id 152FA3EC; Sun, 30 Jun 2013 17:19:25 -0400 (EDT)
+Date: Sun, 30 Jun 2013 17:19:24 -0400
+From: "Andrew J. Schorr" <address@hidden>
+To: Aharon Robbins <address@hidden>
+Message-ID: <address@hidden>
+References: <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden> <address@hidden>
+       <address@hidden>
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="6c2NcOVqGQ03X4Wi"
+Content-Disposition: inline
+In-Reply-To: <address@hidden>
+User-Agent: Mutt/1.5.21 (2010-09-15)
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic]
+X-Received-From: 38.76.0.51
+Cc: address@hidden
+Subject: Re: [gawk-devel] generalizing socket i/o
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+Status: RO
+X-Status: A
+Content-Length: 11770
+Lines: 320
+
+
+--6c2NcOVqGQ03X4Wi
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: inline
+
+Hi all,
+
+I started to work on this.  I have encountered a few "challenges" :-).
+Here's a test program that demonstrates some basic functionality:
+
address@hidden "select"
address@hidden "time"
+
+BEGIN {
+   start = gettimeofday()
+   cmd["echo A:msg1; sleep 1; echo A:msg2; sleep 2; echo A:msg3"] = ""
+   cmd["sleep 1; echo B:msg1; sleep 2; echo B:msg2; sleep 1; echo B:msg3"] = ""
+
+   # XXX fire up child processes: we need a way to launch them without reading
+   # the first line of input!
+   for (i in cmd) {
+      i | getline x
+      printf "%.6f cmd [%s]: %s\n", gettimeofday()-start, i, x
+   }
+   delete writefds
+   delete exceptds
+   while (length(cmd) > 0) {
+      delete readfds
+      for (i in cmd)
+         readfds[i] = ""
+      switch (select(readfds, writefds, exceptfds)) {
+      case -1:
+         printf "Error: select failed: %s\n", ERRNO > "/dev/stderr"
+         exit 1
+      case 0:
+         print "Timeout.  Trying again."
+         break
+      default:
+         for (i in readfds) {
+            if ((rc = (i | getline x)) > 0)
+               printf "%.6f cmd [%s]: %s\n", gettimeofday()-start, i, x
+            else {
+               delete cmd[i]
+               if (rc < 0) {
+                  printf "Error: getline(%s) failed, errno = %s\n", i, ERRNO
+                  erc = 1
+               }
+            }
+         }
+         break
+      }
+   }
+   exit erc+0
+}
+
+And the output:
+
address@hidden: ./gawk -f /tmp/multiplex.awk
+1.005721 cmd [sleep 1; echo B:msg1; sleep 2; echo B:msg2; sleep 1; echo 
B:msg3]: B:msg1
+1.007885 cmd [echo A:msg1; sleep 1; echo A:msg2; sleep 2; echo A:msg3]: A:msg1
+2.009040 cmd [echo A:msg1; sleep 1; echo A:msg2; sleep 2; echo A:msg3]: A:msg2
+3.007013 cmd [sleep 1; echo B:msg1; sleep 2; echo B:msg2; sleep 1; echo 
B:msg3]: B:msg2
+4.008378 cmd [sleep 1; echo B:msg1; sleep 2; echo B:msg2; sleep 1; echo 
B:msg3]: B:msg3
+4.010283 cmd [echo A:msg1; sleep 1; echo A:msg2; sleep 2; echo A:msg3]: A:msg3
address@hidden: ./gawk -f /tmp/multiplex.awk
+1.002733 cmd [sleep 1; echo B:msg1; sleep 2; echo B:msg2; sleep 1; echo 
B:msg3]: B:msg1
+1.004928 cmd [echo A:msg1; sleep 1; echo A:msg2; sleep 2; echo A:msg3]: A:msg1
+2.006261 cmd [echo A:msg1; sleep 1; echo A:msg2; sleep 2; echo A:msg3]: A:msg2
+3.004054 cmd [sleep 1; echo B:msg1; sleep 2; echo B:msg2; sleep 1; echo 
B:msg3]: B:msg2
+4.005410 cmd [sleep 1; echo B:msg1; sleep 2; echo B:msg2; sleep 1; echo 
B:msg3]: B:msg3
+4.007458 cmd [echo A:msg1; sleep 1; echo A:msg2; sleep 2; echo A:msg3]: A:msg3
+
+I haven't pushed the branch yet, because I'm not quite ready to commit
+this code.  I first need to figure out how to solve the following problems:
+
+1. When trying to read from the current input file (i.e. the data found in
+the FILENAME), there's a bootstrapping problem.  When the BEGIN rule executes,
+the input files have not been opened yet.  So if one tries to lookup the
+current value of FILENAME, it is NULL.  In normal execution, when one
+calls getline or processes the first line of input the regular way, the
+code calls "nextfile(& curfile, false)".  You can see this in "interpret.h"
+in the Op_newfile and Op_K_getline sections.  That's what bootstraps the
+reading of the files.  After nextfile is called the first time, it returns
+a positive value, and this tells the calling code to run the beginfile logic
+by executing 'JUMPTO((pc + 1)->target_beginfile'.  I'd like the lookup_file
+code to see that curfile is NULL and recognize that it needs to bootstrap
+the file reading by calling nextfile(& curfile, false) and then execute
+the beginfile rules, but I don't know how to run the BEGINFILE targets.
+I would appreciate help with that.
+
+2. I will need a way to bootstrap pipes and coprocess fds.  In the usual case,
+gawk calls io.c:redirect() to open a pipe when the first getline call occurs.
+In our case, we want to open the popes and/or sockets prior to calling select
+the first time.  I will need to add a new open_file API call that takes the
+name of a command and redirection type and calls the redirect() function.
+My current plan is to change the select calling convention so that the array
+value for a given filename contains the requested open mode (one of ">", ">>",
+"<", "|&", and "|").  So in the above program, it might say:
+   cmd["echo A:msg1; sleep 1; echo A:msg2; sleep 2; echo A:msg3"] = "|"
+   cmd["sleep 1; echo B:msg1; sleep 2; echo B:msg2; sleep 1; echo B:msg3"] = 
"|"
+Since they appear in the readfds array, we know that this is an input
+pipe, not output.
+
+3. The tcp server logic was designed to be single-threaded.  If you try to read
+input from a server socket, it waits for a client to connect, closes the
+listener socket, and then processes I/O from the newly connected socket.  If I
+could start over, I'd change the TCP server mechanism to work something like
+this:
+
+   server = "/inet/tcp/8080/0/0"
+   while (1) {
+      # wait for a client to connect
+      server |& getline client
+      # at this point, client contains the handle for the connected socket,
+      # something like "/inet/tcp/8080/client-host/client-port", and the server
+      # socket should still be open to accept new connections!
+      while ((client |& getline x) > 0)
+        printf "client %s says: %s\n", client, x
+      close(client)
+   }
+
+If it had been done that way, it would be easy to use the new select
+multiplexing mechanisms to service multiple connected clients at once.
+Since it was not designed that way, I'm not sure how best to remedy this.
+I guess we can add a function to open a socket to listen for connections,
+and another to accept connections, but it may be painful to integrate this
+into the existing socket I/O scheme.  A separate BSD-style API would be
+easy to implement, but it seems suboptimal to have 2 different approaches
+to networking.  Does anbody have any thoughts on how best to solve this?
+
+That's it for now.  The current pre-alpha version of the select extension
+is attached.  Arnold's flatten_array API makes it pretty easy -- thanks
+Arnold!
+
+I think I know how to solve problem #2, but I'm currently stumped on #1 (I
+think I need to find a way to run the rule_block[BEGINFILE] code, but I don't
+know how).  I don't consider #3 an urgent problem right now, but we should
+figure out how best to handle this to support socket I/O properly.
+
+I haven't started to work on signal support yet.
+
+Regards,
+Andy
+
+--6c2NcOVqGQ03X4Wi
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: attachment; filename="select.c"
+
+/*
+ * select.c - Builtin functions to provide select I/O multiplexing.
+ */
+
+/*
+ * Copyright (C) 2013 the Free Software Foundation, Inc.
+ * 
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ * 
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <assert.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "gawkapi.h"
+
+#include "gettext.h"
+#define _(msgid)  gettext(msgid)
+#define N_(msgid) msgid
+
+static const gawk_api_t *api;  /* for convenience macros to work */
+static awk_ext_id_t *ext_id;
+static const char *ext_version = "ordchr extension: version 1.0";
+static awk_bool_t (*init_func)(void) = NULL;
+
+int plugin_is_GPL_compatible;
+
+#if defined(HAVE_SELECT) && defined(HAVE_SYS_SELECT_H)
+#include <sys/select.h>
+#endif
+
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+
+/*  do_ord --- return numeric value of first char of string */
+
+static awk_value_t *
+do_select(int nargs, awk_value_t *result)
+{
+       static const char *argname[] = { "read", "write", "except" };
+       struct {
+               awk_value_t array;
+               awk_flat_array_t *flat;
+               fd_set bits;
+               int *array2fd;
+       } fds[3];
+       awk_value_t timeout_arg;
+       int i;
+       struct timeval maxwait;
+       struct timeval *timeout;
+       int nfds = 0;
+       int rc;
+
+       if (do_lint && nargs > 5)
+               lintwarn(ext_id, _("select: called with too many arguments"));
+
+       for (i = 0; i < sizeof(fds)/sizeof(fds[0]); i++) {
+               size_t j;
+
+               if (! get_argument(i, AWK_ARRAY, & fds[i].array)) {
+                       warning(ext_id, _("select: bad array parameter `%s'"), 
argname[i]);
+                       update_ERRNO_string(_("select: bad array parameter"));
+                       return make_number(-1, result);
+               }
+               /* N.B. flatten_array fails for empty arrays, so that's OK */
+               FD_ZERO(&fds[i].bits);
+               if (flatten_array(fds[i].array.array_cookie, &fds[i].flat)) {
+                       emalloc(fds[i].array2fd, int *, 
fds[i].flat->count*sizeof(int), "select");
+                       for (j = 0; j < fds[i].flat->count; j++) {
+                               const awk_input_buf_t *buf;
+                               char junk[3];
+
+                               if ((buf = 
lookup_file(fds[i].flat->elements[j].index.str_value.str, 
fds[i].flat->elements[j].index.str_value.len)) != NULL)
+                                       fds[i].array2fd[j] = buf->fd;
+                               else if 
((sscanf(fds[i].flat->elements[j].index.str_value.str, "%d%s", & 
fds[i].array2fd[j], junk) != 1) || (fds[i].array2fd[j] < 0)) {
+                                       warning(ext_id, _("select: lookup_file 
failed on `%s'"), fds[i].flat->elements[j].index.str_value.str);
+                                       update_ERRNO_string(_("select: 
lookup_file failed"));
+                                       if (! 
release_flattened_array(fds[i].array.array_cookie, fds[i].flat))
+                                               warning(ext_id, _("select: 
release_flattened_array failed"));
+                                       free(fds[i].array2fd);
+                                       return make_number(-1, result);
+                               }
+                               FD_SET(fds[i].array2fd[j], &fds[i].bits);
+                               if (nfds <= fds[i].array2fd[j])
+                                       nfds = fds[i].array2fd[j]+1;
+                       }
+               }
+               else
+                       fds[i].flat = NULL;
+       }
+        if (get_argument(3, AWK_NUMBER, &timeout_arg)) {
+               double secs = timeout_arg.num_value;
+               if (secs < 0) {
+                       warning(ext_id, _("select: treating negative timeout as 
zero"));
+                       secs = 0;
+               }
+               maxwait.tv_sec = secs;
+               maxwait.tv_usec = (secs-(double)maxwait.tv_sec)*1000000.0;
+               timeout = &maxwait;
+       } else
+               timeout = NULL;
+       rc = select(nfds, &fds[0].bits, &fds[1].bits, &fds[2].bits, timeout);
+
+       if (rc < 0) {
+               update_ERRNO_int(errno);
+               /* bit masks are undefined, so delete all array entries */
+               for (i = 0; i < sizeof(fds)/sizeof(fds[0]); i++) {
+                       if (fds[i].flat) {
+                               size_t j;
+                               for (j = 0; j < fds[i].flat->count; j++)
+                                       fds[i].flat->elements[j].flags |= 
AWK_ELEMENT_DELETE;
+                               if (! 
release_flattened_array(fds[i].array.array_cookie, fds[i].flat))
+                                       warning(ext_id, _("select: 
release_flattened_array failed"));
+                               free(fds[i].array2fd);
+                       }
+               }
+               return make_number(rc, result);
+       }
+
+       for (i = 0; i < sizeof(fds)/sizeof(fds[0]); i++) {
+               if (fds[i].flat) {
+                       size_t j;
+                       /* remove array elements not set in the bit mask */
+                       for (j = 0; j < fds[i].flat->count; j++) {
+                               if (! FD_ISSET(fds[i].array2fd[j], 
&fds[i].bits))
+                                       fds[i].flat->elements[j].flags |= 
AWK_ELEMENT_DELETE;
+                       }
+                       if (! 
release_flattened_array(fds[i].array.array_cookie, fds[i].flat))
+                               warning(ext_id, _("select: 
release_flattened_array failed"));
+                       free(fds[i].array2fd);
+               }
+       }
+
+       /* Set the return value */
+       return make_number(rc, result);
+}
+
+static awk_ext_func_t func_table[] = {
+       { "select", do_select, 5 },
+};
+
+/* define the dl_load function using the boilerplate macro */
+
+dl_load_func(func_table, select, "")
+
+--6c2NcOVqGQ03X4Wi--
+
+From address@hidden  Sun Jun 30 21:09:45 2013
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti119.telemetry-investments.com (Postfix) with ESMTP id CF54A383
+       for <address@hidden>; Sun, 30 Jun 2013 21:09:45 -0400 (EDT)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id C48A81DC7; Sun, 30 Jun 2013 21:09:45 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id B94DE1DB2
+       for <address@hidden>; Sun, 30 Jun 2013 21:09:45 -0400 (EDT)
+Received: from localhost ([::1]:48598 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1UtScj-0007iC-IX
+       for address@hidden; Sun, 30 Jun 2013 21:09:45 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:37742)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1UtScf-0007hU-Ai
+       for address@hidden; Sun, 30 Jun 2013 21:09:44 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1UtScc-0004yQ-3z
+       for address@hidden; Sun, 30 Jun 2013 21:09:41 -0400
+Received: from gw3a.telemetry-investments.com ([38.76.0.51]:53552
+       helo=sv3.telemetry-investments.com)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1UtScc-0004yM-0O
+       for address@hidden; Sun, 30 Jun 2013 21:09:38 -0400
+Received: from ti119.telemetry-investments.com (ti119 [192.168.53.119])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 43E4A1DB2;
+       Sun, 30 Jun 2013 21:09:37 -0400 (EDT)
+Received: by ti119.telemetry-investments.com (Postfix, from userid 300)
+       id 2F5B33EC; Sun, 30 Jun 2013 21:09:37 -0400 (EDT)
+Date: Sun, 30 Jun 2013 21:09:37 -0400
+From: "Andrew J. Schorr" <address@hidden>
+To: Aharon Robbins <address@hidden>
+Message-ID: <address@hidden>
+References: <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: inline
+In-Reply-To: <address@hidden>
+User-Agent: Mutt/1.5.21 (2010-09-15)
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic]
+X-Received-From: 38.76.0.51
+Cc: address@hidden
+Subject: Re: [gawk-devel] pushed first version of select extension
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+Status: RO
+Content-Length: 4641
+Lines: 117
+
+I just pushed a new "select" branch.  It fixes the problem with starting
+coprocesses and pipes.
+
+I still don't know how to run the BEGINFILE rule for the first file.
+In gawkapi.c:api_get_file, here's where I need help:
+
+        if ((name == NULL) || (namelen == 0)) {
+                if (curfile == NULL) {
+                        if (nextfile(& curfile, false) <= 0)
+                                return NULL;
+                        /* XXX Fix me! */
+                        fputs("Bug: need to call BEGINFILE!\n", stderr);
+                }
+                return &curfile->public;
+        }
+
+Does anybody know how to solve this?
+
+This test program now works OK:
+
address@hidden "select"
address@hidden "time"
+
+BEGIN {
+   start = gettimeofday()
+   cmd["echo A:msg1; sleep 1; echo A:msg2; sleep 2; echo A:msg3"] = "|<"
+   cmd["sleep 1; echo B:msg1; sleep 2; echo B:msg2; sleep 1; echo B:msg3"] = 
"|<"
+
+   delete writefds
+   delete exceptds
+   while (length(cmd) > 0) {
+      delete readfds
+      for (i in cmd)
+        readfds[i] = cmd[i]
+      switch (select(readfds, writefds, exceptfds)) {
+      case -1:
+        printf "Error: select failed: %s\n", ERRNO > "/dev/stderr"
+        exit 1
+      case 0:
+        print "Timeout.  Trying again."
+        break
+      default:
+        for (i in readfds) {
+           if ((rc = (i | getline x)) > 0)
+              printf "%.6f cmd [%s]: %s\n", gettimeofday()-start, i, x
+           else {
+              delete cmd[i]
+              if (rc < 0) {
+                 printf "Error: getline(%s) failed, errno = %s\n", i, ERRNO
+                 erc = 1
+              }
+           }
+        }
+        break
+      }
+   }
+   exit erc+0
+}
+
+Here's the output:
+bash-4.1$ ./gawk -f /tmp/multiplex.awk 
+0.001883 cmd [echo A:msg1; sleep 1; echo A:msg2; sleep 2; echo A:msg3]: A:msg1
+1.002844 cmd [echo A:msg1; sleep 1; echo A:msg2; sleep 2; echo A:msg3]: A:msg2
+1.003278 cmd [sleep 1; echo B:msg1; sleep 2; echo B:msg2; sleep 1; echo 
B:msg3]: B:msg1
+3.003809 cmd [echo A:msg1; sleep 1; echo A:msg2; sleep 2; echo A:msg3]: A:msg3
+4.005850 cmd [sleep 1; echo B:msg1; sleep 2; echo B:msg2; sleep 1; echo 
B:msg3]: B:msg2
+4.005888 cmd [sleep 1; echo B:msg1; sleep 2; echo B:msg2; sleep 1; echo 
B:msg3]: B:msg3
+
+And I am still seeking input on the current behavior of TCP server sockets, as
+discussed here:
+
+On Sun, Jun 30, 2013 at 05:19:24PM -0400, Andrew J. Schorr wrote:
+> 3. The tcp server logic was designed to be single-threaded.  If you try to 
read
+> input from a server socket, it waits for a client to connect, closes the
+> listener socket, and then processes I/O from the newly connected socket.  If 
I
+> could start over, I'd change the TCP server mechanism to work something like
+> this:
+> 
+>    server = "/inet/tcp/8080/0/0"
+>    while (1) {
+>       # wait for a client to connect
+>       server |& getline client
+>       # at this point, client contains the handle for the connected socket,
+>       # something like "/inet/tcp/8080/client-host/client-port", and the 
server
+>       # socket should still be open to accept new connections!
+>       while ((client |& getline x) > 0)
+>       printf "client %s says: %s\n", client, x
+>       close(client)
+>    }
+> 
+> If it had been done that way, it would be easy to use the new select
+> multiplexing mechanisms to service multiple connected clients at once.
+> Since it was not designed that way, I'm not sure how best to remedy this.
+> I guess we can add a function to open a socket to listen for connections,
+> and another to accept connections, but it may be painful to integrate this
+> into the existing socket I/O scheme.  A separate BSD-style API would be
+> easy to implement, but it seems suboptimal to have 2 different approaches
+> to networking.  Does anbody have any thoughts on how best to solve this?
+
+It occurs to me to wonder whether anybody actually uses TCP server sockets
+in the current implementation.  I suspect it is not heavily used, since
+the current features are so limited.  I wonder if it's worth changing it
+to work as I suggest above...
+
+My next steps are to implement signal handling and then look at the
+behavior of getline with timeouts and non-blocking I/O.  Arnold suggested
+having getline return -2 and set ERRNO to ETIMEDOUT (or I guess EAGAIN
+for a situation where it would block).  One immediate question that
+pops to mind: normally, ERRNO contains a string such as "Connection timed out",
+not ETIMEDOUT.  And I assume this message varies based on locale.  So I don't
+see how client code could test for this unless we define some global variables
+ETIMEDOUT and EGAIN that contain the localized versions of those messages.
+Or would it be better to hardwire ERRNO to say "ETIMEDOUT" instead of the
+localized error message associated with that?
+
+Regards,
+Andy
+
+From address@hidden Mon Jul  1 11:49:58 2013
+Return-Path: <address@hidden>
+X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
+ ti9.telemetry-investments.com
+X-Spam-Level: 
+X-Spam-Status: No, score=-2.7 required=10.0 tests=BAYES_00,DKIM_SIGNED,
+ DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham
+ version=3.3.2
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv4.telemetry-investments.com (ti21 [192.168.78.21])
+ by ti119.telemetry-investments.com (Postfix) with ESMTP id DD06C5CF
+ for <address@hidden>;
+ Mon,  1 Jul 2013 11:49:58 -0400 (EDT)
+Received: by sv4.telemetry-investments.com (Postfix)
+ id CB4C11D57; Mon,  1 Jul 2013 11:49:58 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54])
+ by sv4.telemetry-investments.com (Postfix) with ESMTP id 550C31CBB
+ for <address@hidden>; Mon,  1 Jul 2013 11:49:58 -0400 (EDT)
+Received: by mail-ee0-f54.google.com with SMTP id t10so2153775eei.41
+ for <address@hidden>; Mon, 01 Jul 2013 08:49:57 -0700 (PDT)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+ d=googlemail.com; s=20120113;
+ h=message-id:date:from:user-agent:mime-version:to:subject:references
+ :in-reply-to:x-enigmail-version:content-type
+ :content-transfer-encoding;
+ bh=GYcAQb+FmlcdrJ7m8E9mFvzIkDOnXAFJ2wexQr2a5BM=;
+ b=ahG3iNgpQFXJdRAj9uG3EaZheS2obQdinsiYgH2ZBf2ML7xhBIKrXkIl3AkWtEVu5d
+ /rhBkF8eGGM+erXQh3LCgzxqiSvi9Mtemg+UYTHh/4uVCj0dhQxvGcSxsJfmf07cO4Ip
+ VbJcjGty1vljl8IiBdbS4O3i79uv1/MlupGlvVV0NH27rG2GEa55OaWOhck6HGr7HVwR
+ Qvb5Yo7a1EFW+iMVmKDY72DilqfZKE8ksHGvhug7UPwPXobiJtwfP/mxvspEwSQA5O9q
+ MM64HP0CxWvCpAYMBMaSfqONIqzbssYhtMoz44V71XL3LXz9mCpdzQvc4AxZ0ExPZI11
+ WS+w==
+X-Received: by 10.14.48.77 with SMTP id u53mr21449700eeb.154.1372693797199;
+ Mon, 01 Jul 2013 08:49:57 -0700 (PDT)
+Received: from linux-l5kq.site (ip-109-47-96-38.web.vodafone.de.
+ [109.47.96.38])
+ by mx.google.com with ESMTPSA id n42sm30617516eeh.15.2013.07.01.08.49.55
+ for <address@hidden>
+ (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
+ Mon, 01 Jul 2013 08:49:56 -0700 (PDT)
+Message-ID: <address@hidden>
+Date: Mon, 01 Jul 2013 17:49:53 +0200
+From: "=?ISO-8859-1?Q?J=FCrgen_Kahrs?=" <address@hidden>
+User-Agent: Mozilla/5.0 (X11; Linux x86_64;
+ rv:17.0) Gecko/20130510 Thunderbird/17.0.6
+MIME-Version: 1.0
+To: "Andrew J. Schorr" <address@hidden>
+Subject: Re: [gawk-devel] pushed first version of select extension
+References: <address@hidden>
+ <address@hidden>
+ <address@hidden>
+ <address@hidden>
+ <address@hidden>
+ <address@hidden>
+ <address@hidden> <address@hidden>
+ <address@hidden>
+ <address@hidden>
+ <address@hidden>
+In-Reply-To: <address@hidden>
+X-Enigmail-Version: 1.6a1pre
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 7bit
+X-Spambayes-Classification: ham; 0.05
+Status: RO
+X-Status: A
+Content-Length: 792
+Lines: 16
+
+Am 01.07.2013 03:09, schrieb Andrew J. Schorr:
+>
+> It occurs to me to wonder whether anybody actually uses TCP server sockets
+> in the current implementation.  I suspect it is not heavily used, since
+> the current features are so limited.  I wonder if it's worth changing it
+> to work as I suggest above...
+
+Good question, I also doubt that there are many users.
+Now that the extension mechanism is established, we should
+reconsider if it really makes sense to have sockets in the main
+gawk implementation. If you found a way to implement sockets
+in an extension and this extension co-operates nicely with a
+"select extension" and you would draw the consequence of
+suggesting sockets to be kicked out of the main gawk source
+tree into an extension, then I would vote in favour of this idea.
+
+
+From address@hidden  Mon Jul  1 12:03:49 2013
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti119.telemetry-investments.com (Postfix) with ESMTP id 6AD291D9E
+       for <address@hidden>; Mon,  1 Jul 2013 12:03:49 -0400 (EDT)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id 612631D5B; Mon,  1 Jul 2013 12:03:49 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 492C8398
+       for <address@hidden>; Mon,  1 Jul 2013 12:03:49 -0400 (EDT)
+Received: from localhost ([::1]:60885 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1UtgZx-0007bx-79
+       for address@hidden; Mon, 01 Jul 2013 12:03:49 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:48848)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1UtgZk-0007WN-Eo
+       for address@hidden; Mon, 01 Jul 2013 12:03:46 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1UtgZg-0002yS-3W
+       for address@hidden; Mon, 01 Jul 2013 12:03:36 -0400
+Received: from gw3a.telemetry-investments.com ([38.76.0.51]:59949
+       helo=sv3.telemetry-investments.com)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1UtgZf-0002yB-Sk
+       for address@hidden; Mon, 01 Jul 2013 12:03:31 -0400
+Received: from ti119.telemetry-investments.com (ti119 [192.168.53.119])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 3F3061D5B;
+       Mon,  1 Jul 2013 12:03:31 -0400 (EDT)
+Received: by ti119.telemetry-investments.com (Postfix, from userid 300)
+       id 0EEF521B7; Mon,  1 Jul 2013 12:03:30 -0400 (EDT)
+Date: Mon, 1 Jul 2013 12:03:30 -0400
+From: "Andrew J. Schorr" <address@hidden>
+To: =?iso-8859-1?Q?J=FCrgen?= Kahrs <address@hidden>
+Message-ID: <address@hidden>
+References: <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=iso-8859-1
+Content-Disposition: inline
+In-Reply-To: <address@hidden>
+User-Agent: Mutt/1.5.21 (2010-09-15)
+Content-Transfer-Encoding: quoted-printable
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic]
+X-Received-From: 38.76.0.51
+Cc: address@hidden
+Subject: Re: [gawk-devel] pushed first version of select extension
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+Status: RO
+Content-Length: 3198
+Lines: 82
+
+On Mon, Jul 01, 2013 at 05:49:53PM +0200, J=FCrgen Kahrs wrote:
+> Am 01.07.2013 03:09, schrieb Andrew J. Schorr:
+> > It occurs to me to wonder whether anybody actually uses TCP server so=
+ckets
+> > in the current implementation.  I suspect it is not heavily used, sin=
+ce
+> > the current features are so limited.  I wonder if it's worth changing=
+ it
+> > to work as I suggest above...
+>=20
+> Good question, I also doubt that there are many users.
+> Now that the extension mechanism is established, we should
+> reconsider if it really makes sense to have sockets in the main
+> gawk implementation. If you found a way to implement sockets
+> in an extension and this extension co-operates nicely with a
+> "select extension" and you would draw the consequence of
+> suggesting sockets to be kicked out of the main gawk source
+> tree into an extension, then I would vote in favour of this idea.
+
+I did not intend to propose removing sockets from the main gawk source.  =
+I
+think it may be possible to improve the current implementation of TCP ser=
+ver
+sockets.  I am simply proposing that when somebody runs getline on a TCP =
+server
+socket, instead of closing the server socket and returning data from the =
+newly
+connected socket, it should instead leave the server socket open and retu=
+rn the
+new filename for the connected socket.  This would enable a true TCP
+multiplexing server to be implemented.  I think this can be done without
+changing anything else in the current sockets implementation.
+
+The problem code is in io.c:socketopen() here:
+
+                                if (type =3D=3D SOCK_STREAM) {
+                                        int clientsocket_fd =3D INVALID_H=
+ANDLE;
+
+                                        struct sockaddr_storage remote_ad=
+dr;
+                                        socklen_t namelen =3D sizeof(remo=
+te_addr);
+
+                                        if (listen(socket_fd, 1) >=3D 0
+                                            && (clientsocket_fd =3D accep=
+t(socket_fd,
+                                                (struct sockaddr *) & rem=
+ote_addr,
+                                                & namelen)) >=3D 0) {
+                                                closemaybesocket(socket_f=
+d);
+                                                socket_fd =3D clientsocke=
+t_fd;
+                                                break;
+                                        }
+
+It calls listen, then accept, and then close on the server socket fd.  I =
+would
+remove those calls to accept and close, and just return the server socket=
+ after
+calling listen.
+
+We then need to have a special input parser for TCP server sockets that
+would accept new connections and build a new file handle for the connecte=
+d
+socket.
+
+I haven't looked at UDP sockets.  There may be a similar problem with UDP
+server sockets.
+
+Of course, it would be much simpler to have a normal BSD-style socket
+extension.  But it would lose the AWK character of the current implementa=
+tion.
+
+Another alternative is to leave the current socket code as is, and simply
+add a BSD-style sockets API in an extension.  They should be able to coex=
+ist
+without any problem.
+
+Regards,
+Andy
+
+From address@hidden  Tue Jul  2 12:48:03 2013
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti119.telemetry-investments.com (Postfix) with ESMTP id AB5B1369
+       for <address@hidden>; Tue,  2 Jul 2013 12:48:03 -0400 (EDT)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id 9DF821D39; Tue,  2 Jul 2013 12:48:03 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 8DD0753
+       for <address@hidden>; Tue,  2 Jul 2013 12:48:03 -0400 (EDT)
+Received: from localhost ([::1]:48820 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1Uu3kJ-0003yd-G9
+       for address@hidden; Tue, 02 Jul 2013 12:48:03 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:53199)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1Uu3kC-0003xR-V3
+       for address@hidden; Tue, 02 Jul 2013 12:48:00 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1Uu3k9-0003W7-7e
+       for address@hidden; Tue, 02 Jul 2013 12:47:56 -0400
+Received: from gw3a.telemetry-investments.com ([38.76.0.51]:39707
+       helo=sv3.telemetry-investments.com)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1Uu3k9-0003Vy-2n
+       for address@hidden; Tue, 02 Jul 2013 12:47:53 -0400
+Received: from ti119.telemetry-investments.com (ti119 [192.168.53.119])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 667FB53;
+       Tue,  2 Jul 2013 12:47:52 -0400 (EDT)
+Received: by ti119.telemetry-investments.com (Postfix, from userid 300)
+       id 5060D5CF; Tue,  2 Jul 2013 12:47:52 -0400 (EDT)
+Date: Tue, 2 Jul 2013 12:47:52 -0400
+From: "Andrew J. Schorr" <address@hidden>
+To: Aharon Robbins <address@hidden>
+Message-ID: <address@hidden>
+References: <address@hidden>
+       <address@hidden>
+       <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: inline
+In-Reply-To: <address@hidden>
+User-Agent: Mutt/1.5.21 (2010-09-15)
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic]
+X-Received-From: 38.76.0.51
+Cc: address@hidden
+Subject: Re: [gawk-devel] select branch status
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+Status: RO
+Content-Length: 3780
+Lines: 111
+
+Hi,
+
+I just pushed code that seems to work.  Calls to getline should return -2
+when an operation would block or timed out.
+
+Here is some sample code to demonstrate that it works:
+
address@hidden "select"
address@hidden "time"
+
+BEGIN {
+   cmd["echo msg1; echo msg2; sleep 1; echo msg3"] = "|<"
+   cmd["echo B:msg1; sleep 3; echo B:msg2; echo B:msg3; sleep 1; echo B:msg4"] 
= "|<"
+   for (i in cmd)
+      set_non_blocking(i, cmd[i])
+
+   delete writefds
+   delete exceptds
+   start = gettimeofday()
+   while (length(cmd) > 0) {
+      delete readfds
+      for (i in cmd)
+        readfds[i] = cmd[i]
+      switch (select(readfds, writefds, exceptfds)) {
+      case -1:
+        printf "Error: select failed: %s\n", ERRNO > "/dev/stderr"
+        exit 1
+      case 0:
+        print "Timeout.  Trying again."
+        break
+      default:
+        for (i in readfds) {
+           while ((rc = (i | getline x)) > 0)
+              printf "%.1f cmd [%s]: %s\n", gettimeofday()-start, i, x
+           if (rc != -2) {
+              delete cmd[i]
+              if (rc < 0) {
+                 printf "Error: getline(%s) failed, errno = %s\n", i, ERRNO
+                 erc = 1
+              }
+           }
+        }
+        break
+      }
+   }
+   exit erc+0
+}
+
+bash-4.1$ gawk -f /tmp/bufferbug.awk 
+0.0 cmd [echo B:msg1; sleep 3; echo B:msg2; echo B:msg3; sleep 1; echo 
B:msg4]: B:msg1
+0.0 cmd [echo msg1; echo msg2; sleep 1; echo msg3]: msg1
+0.0 cmd [echo msg1; echo msg2; sleep 1; echo msg3]: msg2
+1.0 cmd [echo msg1; echo msg2; sleep 1; echo msg3]: msg3
+3.0 cmd [echo B:msg1; sleep 3; echo B:msg2; echo B:msg3; sleep 1; echo 
B:msg4]: B:msg2
+3.0 cmd [echo B:msg1; sleep 3; echo B:msg2; echo B:msg3; sleep 1; echo 
B:msg4]: B:msg3
+4.0 cmd [echo B:msg1; sleep 3; echo B:msg2; echo B:msg3; sleep 1; echo 
B:msg4]: B:msg4
+
+Everything now prints at the correct time.
+
+There is one thing that took me by surprise.  In io.c:wait_any, I had to
+make the following patch:
+
+@@ -2210,12 +2210,13 @@ wait_any(int interesting)      /* pid of interest, if 
any */
+                               if (pid == redp->pid) {
+                                       redp->pid = -1;
+                                       redp->status = status;
+-                                      break;
++                                      goto finished;
+                               }
+               }
+               if (pid == -1 && errno == ECHILD)
+                       break;
+       }
++finished:
+       signal(SIGHUP, hstat);
+       signal(SIGQUIT, qstat);
+ #endif
+
+I would appreciate it if you can check my logic.  Without the patch, gawk hangs
+in wait_any(0) waiting for children after the first child returns EOF.  It
+loops over calls to wait until wait returns -1.  The patch tells it to
+return from wait_any after it reaps one child.  Is there a reason for the
+existing behavior where it waits until it has reaped all children?
+
+I'm also not 100% confident that my patches to io.c are correct.  It does
+pass "make check" successfully.
+
+Overall, I think it basically works.  I am aware of 3 outstanding issues.
+The first is the big one.
+
+1. I need to find a way to patch gawkapi.c:api_get_file to run the BEGINFILE
+code after opening the first input file.  Any guidance on this would be
+appreciated.
+
+2. I added 2 hooks to the api: lookup_file, and get_file.  In the end, I am
+using only get_file.  Is it worth leaving lookup_file in place, or should
+it be withdrawn?  I'm not sure how useful it is.
+
+3. Regarding the existing TCP/UDP server paradigm: I'm not sure whether it's
+worth changing the existing approach.  It may make more sense to add a separate
+extension for supporting servers properly that gives a bit more control.  The
+existing scheme works fine for clients, but I don't think it really works for
+servers.  I'm open to ideas on this.  It's really a separate discussion.
+
+FYI, I tested the new "select" branch on Cygwin.  It passes "make check",
+and the sample code above works properly.  It also seems to catch signals,
+although it looks like the Cygwin select call is not interrupted by signals,
+so they won't be detected until something else causes the select to exit.
+
+Regards,
+Andy
+
+From address@hidden  Tue Jul  2 22:54:33 2013
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv4.telemetry-investments.com (ti21 [192.168.78.21])
+       by ti119.telemetry-investments.com (Postfix) with ESMTP id 86597383
+       for <address@hidden>; Tue,  2 Jul 2013 22:54:33 -0400 (EDT)
+Received: by sv4.telemetry-investments.com (Postfix)
+       id 74C251D67; Tue,  2 Jul 2013 22:54:33 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv4.telemetry-investments.com (Postfix) with ESMTP id 5BA461D64
+       for <address@hidden>; Tue,  2 Jul 2013 22:54:33 -0400 (EDT)
+Received: from localhost ([::1]:42020 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1UuDDF-0002YQ-1m
+       for address@hidden; Tue, 02 Jul 2013 22:54:33 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:46202)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1UuDD9-0002YI-RJ
+       for address@hidden; Tue, 02 Jul 2013 22:54:31 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1UuDD4-0006TK-NQ
+       for address@hidden; Tue, 02 Jul 2013 22:54:27 -0400
+Received: from gw3a.telemetry-investments.com ([38.76.0.51]:40225
+       helo=sv3.telemetry-investments.com)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1UuDD4-0006TB-J1
+       for address@hidden; Tue, 02 Jul 2013 22:54:22 -0400
+Received: from ti119.telemetry-investments.com (ti119 [192.168.53.119])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 8DE611D3C;
+       Tue,  2 Jul 2013 22:54:21 -0400 (EDT)
+Received: by ti119.telemetry-investments.com (Postfix, from userid 300)
+       id 6398B1DAC; Tue,  2 Jul 2013 22:54:21 -0400 (EDT)
+Date: Tue, 2 Jul 2013 22:54:21 -0400
+From: "Andrew J. Schorr" <address@hidden>
+To: Aharon Robbins <address@hidden>
+Message-ID: <address@hidden>
+References: <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="ZPt4rx8FFjLCG7dd"
+Content-Disposition: inline
+In-Reply-To: <address@hidden>
+User-Agent: Mutt/1.5.21 (2010-09-15)
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic]
+X-Received-From: 38.76.0.51
+Cc: address@hidden
+Subject: Re: [gawk-devel] select branch with support for select, signals,
+ and non-blocking I/O support: mission accomplished?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+Status: RO
+Content-Length: 5781
+Lines: 150
+
+
+--ZPt4rx8FFjLCG7dd
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: inline
+
+I committed the patch to get the BEGINFILE rules to work.  I also withdrew
+the unused lookup_file API, since I think it is perhaps unwise.
+
+I have done some simple testing on Linux and Cygwin.  I am attaching
+a simple test script that exercises some of the features.  You should
+send a SIGINT to the process to see what happens.
+
+You can find the code in the "select" git branch, or you can try this
+tarball: http://sourceforge.net/projects/gawkextlib/files/gawk-select.tar.xz
+
+Here is a summary of the changes.  I haven't written any test cases or
+documentation yet.  I guess the first question is whether the changes
+to the core gawk distribution will be accepted.  If yes, then there's a 
+question of whether the two new extensions should be in the core distribution
+as well.
+
+Changes to gawk core:
+- The numeric value of errno corresponding to the ERRNO variable can
+  now be found in PROCINFO["errno"].
+- The gawk API has a new "get_file" hook that will find or open a file.
+  It takes 2 arguments: the usual awk filename, plus a file type:
+     ">", ">>", "<", "|>", "|<", or "|&"
+- When an I/O operation fails due to a timeout, interrupt, or because it would
+  block, getline should now return -2 and NOT close the file.
+- Fixed what appears to be a bug in wait_any that caused it to wait for
+  all child processes to exit instead of just one.
+
+New errno extension providing 3 functions:
+- strerror(<integer errno value>) returns the strerror value, else ""
+  for an invalid argument.
+- errno2name(<integer errno value>) returns the symbolic name for an errno,
+  else "" for an unknown value.
+- name2errno(<string error name>) returns the symbolic name for an errno, else
+  -1 on error.
+
+Examples:
+   bash-4.1$ echo 11 | gawk -l errno '{print errno2name($1), strerror($1)}'
+   EAGAIN Resource temporarily unavailable
+   bash-4.1$ echo EAGAIN | gawk -l errno '{print name2errno($1)}'
+   11
+
+New select extension providing 3 functions:
+- select_signal(<signal name>, {default|ignore|trap})
+  Returns 0 on success or -1 on error.  Any trapped signals will be reported
+  in the results from the select function.
+- set_non_blocking(<command>, <command type>)
+  Returns 0 on success and -1 on error.  The command is a normal gawk-style
+  command string, and the file type is one of:
+     ">", ">>", "<", "|>", "|<", or "|&"
+  Note: if the <command> has a numeric value and the <command type> is
+  omitted or empty, the function treats the argument as an integer fd value
+  and sets it to non-blocking.
+- select(<readfds>, <writefds>, <exceptfds>, <timeout>, <signals>)
+  Returns -1 on error or the number of file descriptors that matched.
+  On return, the <signals> array contains a list of signals that were trapped
+  since the last call.  The index is the signal number, and the value
+  will be the symbolic signal name (e.g. "INT") if we are able to look it up.
+  If <timeout> is present and numeric, that is the maximum number of seconds
+  to wait.  Otherwise, it will block indefinitely.
+  The <readfds>, <writefds>, and <exceptfds> arrays will have the <command>
+  in the index, and the <command type> as the value.  This works the same
+  way as the set_non_blocking function.  If the index value is numeric
+  and the value is "", it will be treated as a file descriptor.
+
+One note regarding signal behavior: the extension uses sigaction to request
+that signal calls be restarted.  But on Linux, the "select" is always
+interrupted in any case.  So that's nice -- the signals get delivered quickly.
+On Cygwin, I noticed that select does seem to restart, so the signal is
+not delivered to the application right away.
+
+That's all I can think of.  Please test it and let me know if it works for you.
+Feedback on the design would also be appreciated.
+
+As I mentioned previously, TCP and UDP servers do not work well because of the
+design of the current socket implementation.  We may need to write a new
+sockets extension to implement servers properly.  To do so my require a
+new API function that allows an extension to insert a file descriptor
+(and associated filename) into the io.c:red_head struct redirect list.
+I think it basically just needs an additional fd arg for a file that is
+already open.
+
+I will now return to my day job. :-)
+
+Regards,
+Andy
+
+--ZPt4rx8FFjLCG7dd
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: attachment; filename="multiplex.awk"
+
address@hidden "select"
address@hidden "time"
address@hidden "errno"
+
+BEGIN {
+   print "My pid is", PROCINFO["pid"]
+   select_signal("int", "trap")
+
+   cmd["echo A:msg1; sleep 2; echo A:msg2; echo A:backtoback; sleep 4; echo 
A:msg3"] = "|<"
+   cmd["sleep 3; echo B:msg1; echo B:again; sleep 2; echo B:msg2; sleep 4; 
echo B:msg3"] = "|<"
+
+   for (i in cmd)
+      set_non_blocking(i, cmd[i])
+
+   delete writefds
+   delete exceptds
+   start = gettimeofday()
+   EINTR = name2errno("EINTR")
+   while (length(cmd) > 0) {
+      delete readfds
+      for (i in cmd)
+        readfds[i] = cmd[i]
+      rc = select(readfds, writefds, exceptfds, "", sigs)
+      for (i in sigs)
+        printf "Caught signal %d (%s)\n", i, sigs[i]
+      switch (rc) {
+      case -1:
+        if (PROCINFO["errno"] == EINTR) {
+           print "Select failed due to EINTR; trying again."
+           break
+        }
+        printf "Error: select failed: %s\n", ERRNO > "/dev/stderr"
+        exit 1
+      case 0:
+        print "Timeout.  Trying again."
+        break
+      default:
+        for (i in readfds) {
+           while ((rc = (i | getline x)) > 0)
+              printf "%.1f cmd [%s]: %s\n", gettimeofday()-start, i, x
+           if (rc != -2) {
+              delete cmd[i]
+              if (rc < 0) {
+                 printf "Error: getline(%s) failed, errno = %s\n", i, ERRNO
+                 erc = 1
+              }
+           }
+        }
+        break
+      }
+   }
+   exit erc+0
+}
+
+--ZPt4rx8FFjLCG7dd--
+
+From address@hidden  Sun Feb 28 13:06:51 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id C667F3D0
+       for <address@hidden>; Sun, 28 Feb 2016 13:06:51 -0500 (EST)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id B6C286C2; Sun, 28 Feb 2016 13:06:51 -0500 (EST)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 58283343
+       for <address@hidden>; Sun, 28 Feb 2016 13:06:50 -0500 (EST)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 58283343
+Authentication-Results: sv3.telemetry-investments.com; dmarc=none 
header.from=gnu.org
+Received: from localhost ([::1]:60088 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1aa5k1-0007bK-A3
+       for address@hidden; Sun, 28 Feb 2016 13:06:49 -0500
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:52225)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1aa5jz-0007bE-Sl
+       for address@hidden; Sun, 28 Feb 2016 13:06:48 -0500
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1aa5jv-0006oM-QF
+       for address@hidden; Sun, 28 Feb 2016 13:06:47 -0500
+Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39708)
+       by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <address@hidden>)
+       id 1aa5jv-0006o9-Mx
+       for address@hidden; Sun, 28 Feb 2016 13:06:43 -0500
+Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3515
+       helo=home-c4e4a596f7)
+       by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
+       (Exim 4.82) (envelope-from <address@hidden>) id 1aa5jv-0004Qr-0A
+       for address@hidden; Sun, 28 Feb 2016 13:06:43 -0500
+Date: Sun, 28 Feb 2016 20:06:28 +0200
+Message-Id: <address@hidden>
+From: Eli Zaretskii <address@hidden>
+To: address@hidden
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
+X-Received-From: 2001:4830:134:3::e
+Subject: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+Reply-To: Eli Zaretskii <address@hidden>
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 208
+Lines: 5
+
+I tried the UDP server/client example from the manual today, and it
+didn't work for me with Gawk 4.1.3, neither on MS-Windows nor on
+GNU/Linux.  Did some code bitrot?  Can anyone make that example work?
+
+TIA
+
+From address@hidden  Sun Feb 28 15:02:35 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id BAD7F3DA
+       for <address@hidden>; Sun, 28 Feb 2016 15:02:35 -0500 (EST)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id AC8566C2; Sun, 28 Feb 2016 15:02:35 -0500 (EST)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 5B1843E8
+       for <address@hidden>; Sun, 28 Feb 2016 15:02:35 -0500 (EST)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 5B1843E8
+Authentication-Results: sv3.telemetry-investments.com; dmarc=pass 
header.from=googlemail.com
+Authentication-Results: sv3.telemetry-investments.com;
+       dkim=pass (2048-bit key) header.d=googlemail.com address@hidden 
header.b=RwRCZR2u
+Received: from localhost ([::1]:60457 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1aa7Y1-00088j-Cf
+       for address@hidden; Sun, 28 Feb 2016 15:02:33 -0500
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:49063)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1aa7Xy-00088c-3Y
+       for address@hidden; Sun, 28 Feb 2016 15:02:31 -0500
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1aa7Xu-0002ED-QH
+       for address@hidden; Sun, 28 Feb 2016 15:02:30 -0500
+Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:37593)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1aa7Xu-0002E9-F7
+       for address@hidden; Sun, 28 Feb 2016 15:02:26 -0500
+Received: by mail-wm0-x236.google.com with SMTP id p65so21158646wmp.0
+       for <address@hidden>; Sun, 28 Feb 2016 12:02:26 -0800 (PST)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=googlemail.com; s=20120113;
+       h=from:subject:to:references:message-id:date:user-agent:mime-version
+       :in-reply-to; bh=Cq/AQONrS5Pc0V122Lte12/axF+wQQ/P0zJJrFV0yaY=;
+       b=RwRCZR2uUbOEfSnjhwtFNcV7wuEeC2jcXTAuYcExCGVY5lDERreclYQVXVRTqkf/4H
+       unum7ZVDmMPnl9uRzyMzn/jjy1FDmg3jgaOAa1HWYo5hMs5obZkoxFW6J+/o90ieEfHb
+       krQmcuiUW+A5uNClN42xsIelftRZ552j6eL7wlJO9C/l7YB5UJ2T6qNQwOrFyLlln2+4
+       0q5SPZPsrrmt79pPHRjnTwH2MsMboIHBIBUbu4Kjv7EvBBxCcY7SUZYlRVkVDX7ay+j/
+       JB4do9LVtNu9yEerLih3W9T+EtBCIPdjieOAtJir3UEc4LqsT1g1oxqspBs6oemgwBmO
+       EDqQ==
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=1e100.net; s=20130820;
+       h=x-gm-message-state:from:subject:to:references:message-id:date
+       :user-agent:mime-version:in-reply-to;
+       bh=Cq/AQONrS5Pc0V122Lte12/axF+wQQ/P0zJJrFV0yaY=;
+       b=M6s4xeBthPgzXf3L//yeNSBxsIh8mwRIrQgVN5XW4xak/X1Kf8G40m1IAzTQl1SgmE
+       2Vr3oeuUFpjfpZzb2Yc2d/nDUGmLdyn423P/C+l581TvQQsuoo87C63b9/riStxaiDcD
+       aC9NBpEa/9KN71h4JRYrNOnPIg+Ob+2uES8nlEH1ra9sV1zq/4yMTU0vV3hZj60JZU1p
+       VfiiX8PqN5Uw2EPU5BwJ9vFIvfcpe2X6S3nKMgfFrwYjXAPmMzbKJxOQD6LidXDeX6l2
+       5g0vQwWTWAd6P9cf0y5dmSpfFsXCYugvIn/9AMoI1X5DUWeUMMHCF54RkKH0crcAcAw6
+       WcDA==
+X-Gm-Message-State: 
AD7BkJKkMZOjQDlJvcYuseem7nVI0fN6fFectUfb+DWhZPQH6O7bG8D2AQ022CfqbM9gEA==
+X-Received: by 10.194.82.41 with SMTP id f9mr11255322wjy.139.1456689745459;
+       Sun, 28 Feb 2016 12:02:25 -0800 (PST)
+Received: from [192.168.0.11] (ip5f5ac869.dynamic.kabel-deutschland.de.
+       [95.90.200.105]) by smtp.googlemail.com with ESMTPSA id
+       x66sm12958996wmb.20.2016.02.28.12.02.24 for <address@hidden>
+       (version=TLSv1/SSLv3 cipher=OTHER);
+       Sun, 28 Feb 2016 12:02:24 -0800 (PST)
+From: "=?UTF-8?Q?J=c3=bcrgen_Kahrs?=" <address@hidden>
+X-Google-Original-From: =?UTF-8?Q?J=c3=bcrgen_Kahrs?=
+       <address@hidden>
+To: address@hidden
+References: <address@hidden>
+Message-ID: <address@hidden>
+Date: Sun, 28 Feb 2016 21:02:23 +0100
+User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
+       Thunderbird/38.6.0
+MIME-Version: 1.0
+In-Reply-To: <address@hidden>
+Content-Type: multipart/alternative;
+       boundary="------------050908080004020900060306"
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
+X-Received-From: 2a00:1450:400c:c09::236
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 2916
+Lines: 76
+
+This is a multi-part message in MIME format.
+--------------050908080004020900060306
+Content-Type: text/plain; charset=windows-1252
+Content-Transfer-Encoding: 7bit
+
+Am 28.02.2016 um 19:06 schrieb Eli Zaretskii:
+> I tried the UDP server/client example from the manual today, and it
+> didn't work for me with Gawk 4.1.3, neither on MS-Windows nor on
+> GNU/Linux.  Did some code bitrot?  Can anyone make that example work?
+
+I can reproduce the problem with Gawk 4.1.1.
+Both (UDP server and UDP client) don't work correctly.
+
+The UDP server can receive data (I tested this by
+sending him data with the netcat tool), but the UDP
+server cannot reply. The problem seems to have to
+do with an unrecognized address family (in io.c)  that
+is passed to the "connect" function when connecting
+to remote_addr.
+
+The UDP client cannot send data. After successful
+connection, something in the interpreter tries to do
+an
+
+    lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
+
+These problems have probably come up at the time when
+the gethostbyname() was replaced with getaddrinfo().
+I vaguely remember that only the TCP connections were
+tested at that time and the UDP connections did not work.
+
+
+--------------050908080004020900060306
+Content-Type: text/html; charset=windows-1252
+Content-Transfer-Encoding: 8bit
+
+<html>
+  <head>
+    <meta content="text/html; charset=windows-1252"
+      http-equiv="Content-Type">
+  </head>
+  <body bgcolor="#FFFFFF" text="#000000">
+    <div class="moz-cite-prefix">Am 28.02.2016 um 19:06 schrieb Eli
+      Zaretskii:<br>
+    </div>
+    <blockquote cite="mid:address@hidden" type="cite">
+      <pre wrap="">I tried the UDP server/client example from the manual 
today, and it
+didn't work for me with Gawk 4.1.3, neither on MS-Windows nor on
+GNU/Linux.  Did some code bitrot?  Can anyone make that example work?</pre>
+    </blockquote>
+    <br>
+    I can reproduce the problem with Gawk 4.1.1.<br>
+    Both (UDP server and UDP client) don't work correctly.<br>
+    <br>
+    The UDP server can receive data (I tested this by<br>
+    sending him data with the netcat tool), but the UDP<br>
+    server cannot reply. The problem seems to have to<br>
+    do with an unrecognized address family (in io.c)  that<br>
+    is passed to the "connect" function when connecting<br>
+    to remote_addr.<br>
+    <br>
+    The UDP client cannot send data. After successful<br>
+    connection, something in the interpreter tries to do<br>
+    an <br>
+    <blockquote><tt>lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE
+        (Illegal seek)</tt><br>
+    </blockquote>
+    These problems have probably come up at the time when<br>
+    the gethostbyname() was replaced with getaddrinfo().<br>
+    I vaguely remember that only the TCP connections were<br>
+    tested at that time and the UDP connections did not work.<br>
+    <br>
+  </body>
+</html>
+
+--------------050908080004020900060306--
+
+From address@hidden  Mon Feb 29 00:30:38 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id 614473D0
+       for <address@hidden>; Mon, 29 Feb 2016 00:30:38 -0500 (EST)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id 526866C2; Mon, 29 Feb 2016 00:30:38 -0500 (EST)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 2A51B3B2
+       for <address@hidden>; Mon, 29 Feb 2016 00:30:37 -0500 (EST)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 2A51B3B2
+Authentication-Results: sv3.telemetry-investments.com; dmarc=none 
header.from=skeeve.com
+Received: from localhost ([::1]:34211 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1aaGPj-0000KV-NV
+       for address@hidden; Mon, 29 Feb 2016 00:30:35 -0500
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:40478)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1aaGP1-0007lJ-BT
+       for address@hidden; Mon, 29 Feb 2016 00:29:52 -0500
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1aaGOy-0007Mk-4A
+       for address@hidden; Mon, 29 Feb 2016 00:29:51 -0500
+Received: from mxout7.netvision.net.il ([194.90.6.2]:36840)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1aaGOx-0007Md-SM
+       for address@hidden; Mon, 29 Feb 2016 00:29:48 -0500
+MIME-version: 1.0
+Content-transfer-encoding: 7BIT
+Content-type: text/plain; CHARSET=US-ASCII
+Received: from skeeve.com ([89.138.173.41]) by mxout7.netvision.net.il
+       (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit
+       (built Nov
+       17 2011)) with ESMTPSA id <address@hidden>
+       for address@hidden; Mon, 29 Feb 2016 07:29:47 +0200 (IST)
+Received: from skeeve.com (skeeve.com [127.0.0.1])
+       by skeeve.com (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id
+       u1T5TkTw002992; Mon, 29 Feb 2016 07:29:46 +0200
+Received: (from address@hidden)        by skeeve.com (8.14.4/8.14.4/Submit)
+       id u1T5Tk2m002991; Mon, 29 Feb 2016 07:29:46 +0200
+From: Aharon Robbins <address@hidden>
+Message-id: <address@hidden>
+Date: Mon, 29 Feb 2016 07:29:46 +0200
+To: address@hidden, address@hidden
+References: <address@hidden> <address@hidden>
+In-reply-to: <address@hidden>
+User-Agent: Heirloom mailx 12.5 6/20/10
+X-detected-operating-system: by eggs.gnu.org: Solaris 10
+X-Received-From: 194.90.6.2
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 1486
+Lines: 40
+
+Hi Juergen,
+
+Can you take a look at making this work again?  It's entirely possible
+I messed something up when I moved to getaddrinfo.  I don't have tons
+of cycles at the moment, so I could use some help on this.
+
+Thanks!
+
+Arnold
+
+> From: "J??rgen Kahrs" <address@hidden>
+> To: address@hidden
+> Date: Sun, 28 Feb 2016 21:02:23 +0100
+> Subject: Re: [gawk-devel] UDP networking doesn't work?
+>
+> Am 28.02.2016 um 19:06 schrieb Eli Zaretskii:
+> > I tried the UDP server/client example from the manual today, and it
+> > didn't work for me with Gawk 4.1.3, neither on MS-Windows nor on
+> > GNU/Linux.  Did some code bitrot?  Can anyone make that example work?
+>
+> I can reproduce the problem with Gawk 4.1.1.
+> Both (UDP server and UDP client) don't work correctly.
+>
+> The UDP server can receive data (I tested this by
+> sending him data with the netcat tool), but the UDP
+> server cannot reply. The problem seems to have to
+> do with an unrecognized address family (in io.c)  that
+> is passed to the "connect" function when connecting
+> to remote_addr.
+>
+> The UDP client cannot send data. After successful
+> connection, something in the interpreter tries to do
+> an
+>
+>     lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
+>
+> These problems have probably come up at the time when
+> the gethostbyname() was replaced with getaddrinfo().
+> I vaguely remember that only the TCP connections were
+> tested at that time and the UDP connections did not work.
+
+From address@hidden  Mon Feb 29 13:13:12 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id 4DC6029C
+       for <address@hidden>; Mon, 29 Feb 2016 13:13:12 -0500 (EST)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id 42CB56AA; Mon, 29 Feb 2016 13:13:12 -0500 (EST)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 02637461
+       for <address@hidden>; Mon, 29 Feb 2016 13:13:11 -0500 (EST)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 02637461
+Authentication-Results: sv3.telemetry-investments.com; dmarc=pass 
header.from=googlemail.com
+Authentication-Results: sv3.telemetry-investments.com;
+       dkim=pass (2048-bit key) header.d=googlemail.com address@hidden 
header.b=ELI7Fpwy
+Received: from localhost ([::1]:38243 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1aaSJh-00057A-Pk
+       for address@hidden; Mon, 29 Feb 2016 13:13:09 -0500
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:53255)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1aaSJf-00056o-Jh
+       for address@hidden; Mon, 29 Feb 2016 13:13:08 -0500
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1aaSJb-0001Do-Fn
+       for address@hidden; Mon, 29 Feb 2016 13:13:07 -0500
+Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]:38544)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1aaSJb-0001DD-5o
+       for address@hidden; Mon, 29 Feb 2016 13:13:03 -0500
+Received: by mail-wm0-x231.google.com with SMTP id l68so1118675wml.1
+       for <address@hidden>; Mon, 29 Feb 2016 10:13:03 -0800 (PST)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=googlemail.com; s=20120113;
+       h=from:subject:to:references:message-id:date:user-agent:mime-version
+       :in-reply-to:content-transfer-encoding;
+       bh=LYTtAdT/UTx3E0EOPZ595YTbfBQ4SzHOiOmeFLdwIuU=;
+       b=ELI7FpwyCNH39JzOKAYDgP4ACtlIVyPZzuTDB2qSsAW+kkUG9IC/R9Yj7py9JUEP4k
+       CyjuCLHp0wHigLDb1y3gusEY8RC6lvNzQUbL/dcvRga0zFDbI6fuNG71r5hmZ7Idj4xr
+       X8WyYCTnqYHyF/dDnjA1dAdvlHQsLWL3vBw9hpSWPsk+9t3jiMfnqItwZyS8VJj1ocfM
+       zxKQ3bN+eiG4JefyRs5Gdt+6IFuqT+sBNmFd5TmsIpRL8aMpRX8fGeOtLtKNHWN8bWr0
+       LjpFmZ/SSDfxbAVv0XfCZYa4mbS+k6RyYkAhc7nOFnknZcLGsOry2LZW+5te9nSAAcTQ
+       vdNQ==
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=1e100.net; s=20130820;
+       h=x-gm-message-state:from:subject:to:references:message-id:date
+       :user-agent:mime-version:in-reply-to:content-transfer-encoding;
+       bh=LYTtAdT/UTx3E0EOPZ595YTbfBQ4SzHOiOmeFLdwIuU=;
+       b=k+Duxz6/ZDIymj+zkUUTdh1h5BQp4ba+y3U8Aj2J0TxZNX0fT6xQvnMlJEY5bj5X6U
+       LXG5Lau75WXnChtO3FmyzBzUPMFuxEfUTo9BvEOc4Xkzh2sYlkxcr54yynXBrnt49YRo
+       7/LSHb5u98AdzOHLxnlm3HBF+cnOZicXVVDOPVNhMNXUSIV5v7z9XTOcpes0dJ4dTTSX
+       AoZ7wyLqjl6tl4fCecDT6M5v3DjFMDIVNzO0pDzbc+D3X92MTSxj/VqNIrqC5oUZTJZR
+       yAZhk9r2oWLLR0qVp0hkSJ8KwSQjM3UXhX69c4BE/AsV8uGpDFRuCFZ+PWercP13LDgo
+       2hTA==
+X-Gm-Message-State: 
AD7BkJKeJaKUvv+6rpjXy20P3M7QJj/o5c0lxoVNL6KFfxvvp2/rfUKuwdQKlselH7nMfQ==
+X-Received: by 10.28.125.211 with SMTP id y202mr12249564wmc.18.1456769582130; 
+       Mon, 29 Feb 2016 10:13:02 -0800 (PST)
+Received: from [192.168.0.11] (ip5f5ac8a2.dynamic.kabel-deutschland.de.
+       [95.90.200.162]) by smtp.googlemail.com with ESMTPSA id
+       y62sm11675328wmg.12.2016.02.29.10.13.01 for <address@hidden>
+       (version=TLSv1/SSLv3 cipher=OTHER);
+       Mon, 29 Feb 2016 10:13:01 -0800 (PST)
+From: "=?UTF-8?Q?J=c3=bcrgen_Kahrs?=" <address@hidden>
+X-Google-Original-From: =?UTF-8?Q?J=c3=bcrgen_Kahrs?=
+       <address@hidden>
+To: address@hidden
+References: <address@hidden> <address@hidden>
+       <address@hidden>
+Message-ID: <address@hidden>
+Date: Mon, 29 Feb 2016 19:13:00 +0100
+User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
+       Thunderbird/38.6.0
+MIME-Version: 1.0
+In-Reply-To: <address@hidden>
+Content-Type: text/plain; charset=windows-1252
+Content-Transfer-Encoding: 7bit
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
+X-Received-From: 2a00:1450:400c:c09::231
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+X-Status: A
+Content-Length: 485
+Lines: 11
+
+Am 29.02.2016 um 06:29 schrieb Aharon Robbins:
+> Can you take a look at making this work again?  It's entirely possible
+> I messed something up when I moved to getaddrinfo.  I don't have tons
+> of cycles at the moment, so I could use some help on this.
+
+The internal data structures to be used with
+sockets today are very different from what we
+have learned by reading Richard Stevens' books.
+I will have a look at it next weekend.
+If I find a solution, then I will send you a patch.
+
+
+From address@hidden  Mon Feb 29 15:39:54 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id BB5373DA
+       for <address@hidden>; Mon, 29 Feb 2016 15:39:54 -0500 (EST)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id B07986AA; Mon, 29 Feb 2016 15:39:54 -0500 (EST)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 7A5D35A4
+       for <address@hidden>; Mon, 29 Feb 2016 15:39:54 -0500 (EST)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 7A5D35A4
+Authentication-Results: sv3.telemetry-investments.com; dmarc=none 
header.from=telemetry-investments.com
+Authentication-Results: sv3.telemetry-investments.com;
+       dkim=fail reason="key not found in DNS" (0-bit key) 
header.d=telemetry-investments.com address@hidden header.b=WuAqrgOQ
+Received: from localhost ([::1]:39058 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1aaUbi-0001jM-1W
+       for address@hidden; Mon, 29 Feb 2016 15:39:54 -0500
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:59661)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1aaUbf-0001jF-Ct
+       for address@hidden; Mon, 29 Feb 2016 15:39:52 -0500
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1aaUbc-0006B1-5z
+       for address@hidden; Mon, 29 Feb 2016 15:39:51 -0500
+Received: from gw3a.telemetry-investments.com ([38.76.0.51]:55015
+       helo=sv3.telemetry-investments.com)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1aaUbc-0006Ac-2D
+       for address@hidden; Mon, 29 Feb 2016 15:39:48 -0500
+Received: from ti129.telemetry-investments.com (ti129 [192.168.53.129])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 175D75A4;
+       Mon, 29 Feb 2016 15:39:46 -0500 (EST)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=telemetry-investments.com; s=tele1409; t=1456778386;
+       bh=vb6o7x2lB1cZ1DAEnKzPcIXMSA7cfBXegjPCPBg6EJk=;
+       h=Date:From:To:Cc:Subject:References:In-Reply-To;
+       b=WuAqrgOQewxUTuy+uILJtYmQBEiBrfBFcEx1tBRRuCSQnejkmBw2Jx0IpcQ0L7hkE
+       sSfiRpjXCOdKVGuaeRH71wv3gi63oEERFQHBrwiB00BR8sTsL90tLqXk5MNOZtPgrA
+       vsi/1GsVejW3Xh6Mq9FBaZdQv0KSFlPJhVIy11x0=
+Received: by ti129.telemetry-investments.com (Postfix, from userid 300)
+       id 0254C3B21; Mon, 29 Feb 2016 15:39:45 -0500 (EST)
+Date: Mon, 29 Feb 2016 15:39:45 -0500
+From: "Andrew J. Schorr" <address@hidden>
+To: =?iso-8859-1?Q?J=FCrgen?= Kahrs <address@hidden>
+Message-ID: <address@hidden>
+References: <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=iso-8859-1
+Content-Disposition: inline
+In-Reply-To: <address@hidden>
+User-Agent: Mutt/1.5.23 (2014-03-12)
+Content-Transfer-Encoding: quoted-printable
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
+X-Received-From: 38.76.0.51
+Cc: address@hidden
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 903
+Lines: 23
+
+On Mon, Feb 29, 2016 at 07:13:00PM +0100, J=FCrgen Kahrs wrote:
+> Am 29.02.2016 um 06:29 schrieb Aharon Robbins:
+> > Can you take a look at making this work again?  It's entirely possibl=
+e
+> > I messed something up when I moved to getaddrinfo.  I don't have tons
+> > of cycles at the moment, so I could use some help on this.
+>=20
+> The internal data structures to be used with
+> sockets today are very different from what we
+> have learned by reading Richard Stevens' books.
+> I will have a look at it next weekend.
+> If I find a solution, then I will send you a patch.
+
+If you are unable to solve it, it would at least be helpful to share some
+specific examples with the expected and current (incorrect) behavior. Tha=
+t
+should make it much easier to troubleshoot and fix. I tried to strace the
+process to see what's going on, but I'm not sure I was working on the rig=
+ht
+sample code.
+
+Thanks,
+Andy
+
+From address@hidden Mon Feb 29 15:53:39 2016
+Return-Path: <address@hidden>
+X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
+ ti9.telemetry-investments.com
+X-Spam-Level: 
+X-Spam-Status: No, score=-6.9 required=10.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,
+ RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RP_MATCHES_RCVD autolearn=ham
+ autolearn_force=no version=3.4.0
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+ by ti129.telemetry-investments.com (Postfix) with ESMTP id 990F73DA
+ for <address@hidden>;
+ Mon, 29 Feb 2016 15:53:39 -0500 (EST)
+Received: by sv3.telemetry-investments.com (Postfix)
+ id 8C7A36AA; Mon, 29 Feb 2016 15:53:39 -0500 (EST)
+Delivered-To: address@hidden
+Received: from eggs.gnu.org (eggs.gnu.org [208.118.235.92])
+ by sv3.telemetry-investments.com (Postfix) with ESMTP id 4BB4C5A4
+ for <address@hidden>; Mon, 29 Feb 2016 15:53:38 -0500 (EST)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 4BB4C5A4
+Authentication-Results: sv3.telemetry-investments.com;
+ dmarc=none header.from=gnu.org
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+ (envelope-from <address@hidden>) id 1aaUoz-00022z-Pz
+ for address@hidden; Mon, 29 Feb 2016 15:53:38 -0500
+Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37766)
+ by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <address@hidden>)
+ id 1aaUot-00022S-Rj; Mon, 29 Feb 2016 15:53:31 -0500
+Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1138
+ helo=home-c4e4a596f7)
+ by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
+ (Exim 4.82) (envelope-from <address@hidden>)
+ id 1aaUot-0003Id-4U; Mon, 29 Feb 2016 15:53:31 -0500
+Date: Mon, 29 Feb 2016 22:53:19 +0200
+Message-Id: <address@hidden>
+From: Eli Zaretskii <address@hidden>
+To: "Andrew J. Schorr" <address@hidden>
+CC: address@hidden, address@hidden
+In-reply-to: <address@hidden>
+ (address@hidden)
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+Reply-to: Eli Zaretskii <address@hidden>
+References: <address@hidden> <address@hidden>
+ <address@hidden>
+ <address@hidden>
+ <address@hidden>
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
+X-Received-From: 2001:4830:134:3::e
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+ designates 208.118.235.92 as permitted sender)
+ receiver=sv3.telemetry-investments.com; client-ip=208.118.235.92;
+ envelope-from=<address@hidden>; helo=eggs.gnu.org;
+X-Spambayes-Classification: ham; 0.00
+Status: RO
+X-Status: A
+Content-Length: 913
+Lines: 29
+
+> Date: Mon, 29 Feb 2016 15:39:45 -0500
+> From: "Andrew J. Schorr" <address@hidden>
+> Cc: address@hidden
+> 
+> If you are unable to solve it, it would at least be helpful to share some
+> specific examples with the expected and current (incorrect) behavior. That
+> should make it much easier to troubleshoot and fix. I tried to strace the
+> process to see what's going on, but I'm not sure I was working on the right
+> sample code.
+
+The sample code is from the manual:
+
+     # Server
+     BEGIN {
+       print strftime() |& "/inet/udp/8888/0/0"
+       close("/inet/udp/8888/0/0")
+     }
+
+     # Client
+     BEGIN {
+       "/inet/udp/0/localhost/8888" |& getline
+       print $0
+       close("/inet/udp/0/localhost/8888")
+     }
+
+Launch the client first, then the server.  The server exists
+immediately (after seemingly have sent the data), while the client
+hangs without receiving anything.
+
+
+From address@hidden  Mon Feb 29 16:05:16 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id 9D10B3DA
+       for <address@hidden>; Mon, 29 Feb 2016 16:05:16 -0500 (EST)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id 927846AA; Mon, 29 Feb 2016 16:05:16 -0500 (EST)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 60D965A4
+       for <address@hidden>; Mon, 29 Feb 2016 16:05:16 -0500 (EST)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 60D965A4
+Authentication-Results: sv3.telemetry-investments.com; dmarc=none 
header.from=telemetry-investments.com
+Authentication-Results: sv3.telemetry-investments.com;
+       dkim=fail reason="key not found in DNS" (0-bit key) 
header.d=telemetry-investments.com address@hidden header.b=AowHxOcX
+Received: from localhost ([::1]:39152 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1aaV0F-0006WM-Rb
+       for address@hidden; Mon, 29 Feb 2016 16:05:15 -0500
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:39030)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1aaV0C-0006U0-R2
+       for address@hidden; Mon, 29 Feb 2016 16:05:13 -0500
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1aaV0C-000506-3B
+       for address@hidden; Mon, 29 Feb 2016 16:05:12 -0500
+Received: from gw3a.telemetry-investments.com ([38.76.0.51]:55215
+       helo=sv3.telemetry-investments.com)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1aaV06-0004xe-F8; Mon, 29 Feb 2016 16:05:06 -0500
+Received: from ti129.telemetry-investments.com (ti129 [192.168.53.129])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id B37CE5A4;
+       Mon, 29 Feb 2016 16:05:05 -0500 (EST)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=telemetry-investments.com; s=tele1409; t=1456779905;
+       bh=Uo2h8QVk3LFkYRpl//RgEad2m5RrZBF16zjLTxQjP0A=;
+       h=Date:From:To:Cc:Subject:References:In-Reply-To;
+       b=AowHxOcXSdBCZ4JnIBjnmJPHCpMTk2aYdpTnoYy+P489X1yvtX78xeOql8+YjFf3i
+       87Bp8MB9E6wFbyacy0SmKA2v1mF4sWvBR7e5zeIDrlJYKp9wsr+w4ohmexSa+AkwLV
+       XJ7LkXV17v0xW+/k70x9mWWucVNRVkvUyDctjxL0=
+Received: by ti129.telemetry-investments.com (Postfix, from userid 300)
+       id 9647D3B21; Mon, 29 Feb 2016 16:05:05 -0500 (EST)
+Date: Mon, 29 Feb 2016 16:05:05 -0500
+From: "Andrew J. Schorr" <address@hidden>
+To: Eli Zaretskii <address@hidden>
+Message-ID: <address@hidden>
+References: <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: inline
+In-Reply-To: <address@hidden>
+User-Agent: Mutt/1.5.23 (2014-03-12)
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
+X-Received-From: 38.76.0.51
+Cc: address@hidden
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 1478
+Lines: 45
+
+On Mon, Feb 29, 2016 at 10:53:19PM +0200, Eli Zaretskii wrote:
+> The sample code is from the manual:
+> 
+>      # Server
+>      BEGIN {
+>        print strftime() |& "/inet/udp/8888/0/0"
+>        close("/inet/udp/8888/0/0")
+>      }
+> 
+>      # Client
+>      BEGIN {
+>        "/inet/udp/0/localhost/8888" |& getline
+>        print $0
+>        close("/inet/udp/0/localhost/8888")
+>      }
+> 
+> Launch the client first, then the server.  The server exists
+> immediately (after seemingly have sent the data), while the client
+> hangs without receiving anything.
+
+Hmmm. When I run these on Linux using the gawk master branch,
+they both hang. This is on Fedora 21.
+
+According to strace, the client hangs reading this file descriptor:
+   socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 3
+   bind(3, {sa_family=AF_INET, sin_port=htons(0), 
sin_addr=inet_addr("0.0.0.0")}, 16) = 0
+   connect(3, {sa_family=AF_INET, sin_port=htons(8888), 
sin_addr=inet_addr("127.0.0.1")}, 16) = 0
+   ...
+   dup(3)                                  = 4
+   ...
+   read(4, 
+That looks sensible.
+
+And the server hangs here:
+   socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 3
+   bind(3, {sa_family=AF_INET, sin_port=htons(8888), 
sin_addr=inet_addr("0.0.0.0")}, 16) = 0
+   recvfrom(3, 
+
+I don't know why the server is binding that address and reading instead
+of sending a packet to that address. Something is wrong.
+And I also don't know why yours exits and mine hangs. Are you running
+on Windows or Linux?
+
+Regards,
+Andy
+
+From address@hidden Sat Mar  5 23:10:12 2016
+Return-Path: <address@hidden>
+X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
+ ti9.telemetry-investments.com
+X-Spam-Level: 
+X-Spam-Status: No, score=-2.6 required=10.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, 
+ RCVD_IN_MSPIKE_H3,
+ RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.0
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+ by ti129.telemetry-investments.com (Postfix) with ESMTP id C7088269
+ for <address@hidden>;
+ Sat,  5 Mar 2016 23:10:12 -0500 (EST)
+Received: by sv3.telemetry-investments.com (Postfix)
+ id B983E6CE; Sat,  5 Mar 2016 23:10:12 -0500 (EST)
+Delivered-To: address@hidden
+Received: from mxout1.netvision.net.il (mxout1.netvision.net.il [194.90.9.20])
+ by sv3.telemetry-investments.com (Postfix) with ESMTP id 5A405343
+ for <address@hidden>; Sat,  5 Mar 2016 23:10:11 -0500 (EST)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 5A405343
+Authentication-Results: sv3.telemetry-investments.com;
+ dmarc=none header.from=skeeve.com
+MIME-version: 1.0
+Content-transfer-encoding: 7BIT
+Content-type: text/plain; CHARSET=US-ASCII
+Received: from skeeve.com ([93.173.253.111]) by mxout1.netvision.net.il
+ (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov
+ 17 2011)) with ESMTPSA id <address@hidden> for
+ address@hidden; Sun, 06 Mar 2016 06:07:54 +0200 (IST)
+Received: from skeeve.com (skeeve.com [127.0.0.1])
+ by skeeve.com (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id u2647rRg003778; 
+ Sun, 06 Mar 2016 06:07:53 +0200
+Received: (from address@hidden)        by skeeve.com (8.14.4/8.14.4/Submit)
+ id u2647rk3003777; Sun, 06 Mar 2016 06:07:53 +0200
+From: Aharon Robbins <address@hidden>
+Message-id: <address@hidden>
+Date: Sun, 06 Mar 2016 06:07:53 +0200
+To: address@hidden, address@hidden
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+Cc: address@hidden
+References: <address@hidden> <address@hidden>
+ <address@hidden> <address@hidden>
+ <address@hidden>
+ <address@hidden>
+ <address@hidden>
+ <address@hidden>
+In-reply-to: <address@hidden>
+User-Agent: Heirloom mailx 12.5 6/20/10
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: None (sv3.telemetry-investments.com: domain of address@hidden
+ does not designate permitted sender hosts)
+ receiver=sv3.telemetry-investments.com; client-ip=194.90.9.20;
+ envelope-from=<address@hidden>; helo=mxout1.netvision.net.il;
+X-Spambayes-Classification: ham; 0.00
+Status: RO
+Content-Length: 296
+Lines: 14
+
+The UDP examples both hang for me, even when I go back as far as
+gawk 3.1.0!
+
+That's really strange.
+
+Those are old binaries; I may try recompiling old code from source
+to see what I get. I'm on Ubuntu 14.04.
+
+If anyone can make progress on this before me, I'd appreciate it...
+
+Thanks,
+
+Arnold
+
+
+From address@hidden  Sun Mar  6 09:57:54 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id 35FFB3C5
+       for <address@hidden>; Sun,  6 Mar 2016 09:57:54 -0500 (EST)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id 2645F6C5; Sun,  6 Mar 2016 09:57:54 -0500 (EST)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id AEB9E6A4
+       for <address@hidden>; Sun,  6 Mar 2016 09:57:53 -0500 (EST)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com AEB9E6A4
+Authentication-Results: sv3.telemetry-investments.com; dmarc=pass 
header.from=googlemail.com
+Authentication-Results: sv3.telemetry-investments.com;
+       dkim=pass (2048-bit key) header.d=googlemail.com address@hidden 
header.b=g0988vir
+Received: from localhost ([::1]:50813 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1aca7z-00021q-OT
+       for address@hidden; Sun, 06 Mar 2016 09:57:51 -0500
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:38843)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1aca7v-00021j-UG
+       for address@hidden; Sun, 06 Mar 2016 09:57:49 -0500
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1aca7s-0000BS-Mh
+       for address@hidden; Sun, 06 Mar 2016 09:57:47 -0500
+Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:36907)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1aca7s-0000BH-AQ
+       for address@hidden; Sun, 06 Mar 2016 09:57:44 -0500
+Received: by mail-wm0-x22e.google.com with SMTP id p65so43504875wmp.0
+       for <address@hidden>; Sun, 06 Mar 2016 06:57:43 -0800 (PST)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=googlemail.com; s=20120113;
+       h=from:subject:references:to:message-id:date:user-agent:mime-version
+       :in-reply-to; bh=9LNHJzPXV84uMN+GtLUMey/Zm56fsLTTzkmpf1mbiGo=;
+       b=g0988virz+G6qeClQyJXScghW5fzPf1P1M8glgOOnk9Qn0cd1ef4KVl8MwJN1glJW3
+       fyuAPMmp63i2l7VVZu5Wsh/EXKSjG53O8TY3G0n5ZWC54WWD7Pl5KluKf4dWJU0JkyhQ
+       gmsheRZcbhZCx3Ezt4dnzWRyCPeohKGERJIUrOfYn4YAkTeKb0L9cRtX1A95Il9lkC2G
+       yYRQ+AcX84AVyW6tflDBzacoqo9oyvWrwzD9HFoGGklClqqpaR6yF6U1G/ml2ay/aGGc
+       rIBjj71zJh4LP9ojebBszt0R5ZDFMFFIBl7h2L+GXdTBcZd+obCiKCNZjmSiUNX2gGub
+       RqEQ==
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=1e100.net; s=20130820;
+       h=x-gm-message-state:from:subject:references:to:message-id:date
+       :user-agent:mime-version:in-reply-to;
+       bh=9LNHJzPXV84uMN+GtLUMey/Zm56fsLTTzkmpf1mbiGo=;
+       b=axrCCQ/STqjKY3dOd6V4AcFS7DwsQBmOmnQXFUEprIZpgOUbiSRYcvlDb//4UjPDBb
+       ZcxDYPISzEH+BoDIZ54X9D/Fjthxl4TOzrH45U0Ry3DkPE5CMiposhroHrNckxPzJi0M
+       qfmJIqQcNR9F9620q8rAuCzSv3HYoszqNrEwjzKLdaj6guSmmhxliEiFCOPIA4rDNRM4
+       GELqnfVy9Bdume8yiFsjOXZWvDB6olV6E8ZcRRWmu4lxGmWY9btI3Bpk/kRvgS6zPGc3
+       rpfDSf7qG5uPX0oKZpYMRkL1HPb30eBSuoNV3sdKsi3XOICMKf7SE9a21p2kk8RbfXZY
+       guZQ==
+X-Gm-Message-State: 
AD7BkJLIist95OV59smCWVOoW0F6p9utFW58ikfOqKebR2EsRUPzInPaXj8mASrtVNKMpg==
+X-Received: by 10.194.77.193 with SMTP id u1mr18205584wjw.73.1457276263317;
+       Sun, 06 Mar 2016 06:57:43 -0800 (PST)
+Received: from [192.168.0.11] (ip5f5ac802.dynamic.kabel-deutschland.de.
+       [95.90.200.2]) by smtp.googlemail.com with ESMTPSA id
+       h7sm221855wmf.9.2016.03.06.06.57.41 for <address@hidden>
+       (version=TLSv1/SSLv3 cipher=OTHER);
+       Sun, 06 Mar 2016 06:57:42 -0800 (PST)
+From: "=?UTF-8?Q?J=c3=bcrgen_Kahrs?=" <address@hidden>
+X-Google-Original-From: =?UTF-8?Q?J=c3=bcrgen_Kahrs?=
+       <address@hidden>
+References: <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+To: address@hidden
+Message-ID: <address@hidden>
+Date: Sun, 6 Mar 2016 15:57:41 +0100
+User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
+       Thunderbird/38.6.0
+MIME-Version: 1.0
+In-Reply-To: <address@hidden>
+Content-Type: multipart/alternative;
+       boundary="------------030801080701090502000108"
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
+X-Received-From: 2a00:1450:400c:c09::22e
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 8592
+Lines: 190
+
+This is a multi-part message in MIME format.
+--------------030801080701090502000108
+Content-Type: text/plain; charset=windows-1252
+Content-Transfer-Encoding: 8bit
+
+Hello Andrew,
+
+> On Mon, Feb 29, 2016 at 07:13:00PM +0100, Jürgen Kahrs wrote:
+>> Am 29.02.2016 um 06:29 schrieb Aharon Robbins:
+>>> Can you take a look at making this work again?  It's entirely possible
+>>> I messed something up when I moved to getaddrinfo.  I don't have tons
+>>> of cycles at the moment, so I could use some help on this.
+>> The internal data structures to be used with
+>> sockets today are very different from what we
+>> have learned by reading Richard Stevens' books.
+>> I will have a look at it next weekend.
+>> If I find a solution, then I will send you a patch.
+> If you are unable to solve it, it would at least be helpful to share some
+> specific examples with the expected and current (incorrect) behavior. That
+> should make it much easier to troubleshoot and fix.
+
+Eli has already pointed you to the example source code.
+The source code he mentions is indeed the example source
+code as listed in the doc.
+
+> I tried to strace the
+> process to see what's going on, but I'm not sure I was working on the right
+> sample code.
+
+I have also used strace to find out what's going wrong.
+It is essential to see the system calls involved.
+The bug originates in the recvfrom call (line 1598) in io.c (socketopen).
+One the server side do this:
+  strace gawk -f server.awk
+On the client side, do this (instead of using client.awk):
+  echo moin | netcat -u localhost 8888
+
+Now look at what strace tells us.
+
+    socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 3
+    bind(3, {sa_family=AF_INET, sin_port=htons(8888), 
sin_addr=inet_addr("0.0.0.0")}, 16) = 0
+    recvfrom(3, "m", 1, MSG_PEEK, {sa_family=AF_UNSPEC, 
sa_data="\0\0\0\0\0\0\1\0\0\0\0\0\0\0"}, [16]) = 1
+    connect(3, {sa_family=AF_UNSPEC, sa_data="\0\0\0\0\0\0\1\0\0\0\0\0\0\0"}, 
16) = 0
+    fcntl(3, F_GETFD)                       = 0
+    fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
+    fcntl(3, F_GETFL)                       = 0x2 (flags O_RDWR)
+    fstat(3, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
+    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f0217729000
+    lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
+
+The address family as returned by recvfrom() is AF_UNSPEC,
+instead of being AF_INET. The connect() call uses this wrong
+address and things go even more wrongly. Even after reading
+the man page, I haven't understood why we get AF_UNSPEC.
+This behaviour may also depend on the configuration of the
+network on your machine (IPv4 or IPv6 as default). From what
+I understood, I would say that our problems is the same as
+the one described here (in the "Answer" section):
+
+http://stackoverflow.com/questions/18108797/recvfrom-not-receiving-depending-on-ai-family-used
+
+If you want to see what should happen if everything is fine,
+replace server.awk and client.awk by similar netcat usage:
+
+  echo $( date ) | netcat -l -u 8888          # server
+  echo moin | netcat -u localhost 8888    # client
+
+strace with netcat will show system calls similar to what gawk does.
+Hmm, this example shows a slight difference to the
+client.awk that we use. The "echo moin" of the client is
+necessary, but the client.awk does not do this.
+This difference explains what Arnold observed in gawk
+since 3.1.0.
+
+So, the example UDP client code contains a hang.
+But besides this hang problem there is a different problem
+with the AF_UNSPEC.
+
+--------------030801080701090502000108
+Content-Type: text/html; charset=windows-1252
+Content-Transfer-Encoding: 8bit
+
+<html>
+  <head>
+    <meta content="text/html; charset=windows-1252"
+      http-equiv="Content-Type">
+  </head>
+  <body bgcolor="#FFFFFF" text="#000000">
+    <div class="moz-cite-prefix">Hello Andrew,<br>
+      <br>
+    </div>
+    <blockquote
+      cite="mid:address@hidden"
+      type="cite">
+      <pre wrap="">On Mon, Feb 29, 2016 at 07:13:00PM +0100, Jürgen Kahrs 
wrote:
+</pre>
+      <blockquote type="cite">
+        <pre wrap="">Am 29.02.2016 um 06:29 schrieb Aharon Robbins:
+</pre>
+        <blockquote type="cite">
+          <pre wrap="">Can you take a look at making this work again?  It's 
entirely possible
+I messed something up when I moved to getaddrinfo.  I don't have tons
+of cycles at the moment, so I could use some help on this.
+</pre>
+        </blockquote>
+        <pre wrap="">
+The internal data structures to be used with
+sockets today are very different from what we
+have learned by reading Richard Stevens' books.
+I will have a look at it next weekend.
+If I find a solution, then I will send you a patch.
+</pre>
+      </blockquote>
+      <pre wrap="">
+If you are unable to solve it, it would at least be helpful to share some
+specific examples with the expected and current (incorrect) behavior. That
+should make it much easier to troubleshoot and fix.</pre>
+    </blockquote>
+    <br>
+    Eli has already pointed you to the example source code.<br>
+    The source code he mentions is indeed the example source<br>
+    code as listed in the doc.<br>
+    <br>
+    <blockquote
+      cite="mid:address@hidden"
+      type="cite">
+      <pre wrap="">I tried to strace the
+process to see what's going on, but I'm not sure I was working on the right
+sample code.
+</pre>
+    </blockquote>
+    <br>
+    I have also used strace to find out what's going wrong.<br>
+    It is essential to see the system calls involved.<br>
+    The bug originates in the recvfrom call (line 1598) in io.c
+    (socketopen).<br>
+    One the server side do this:<br>
+      <tt>strace gawk -f server.awk</tt><br>
+    On the client side, do this (instead of using client.awk):<br>
+      <tt>echo moin | netcat -u localhost 8888</tt><tt><br>
+    </tt><br>
+    Now look at what strace tells us.<br>
+    <blockquote><tt>socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 3</tt><tt><br>
+      </tt><tt>bind(3, {sa_family=AF_INET, sin_port=htons(8888),
+        sin_addr=inet_addr("0.0.0.0")}, 16) = 0</tt><tt><br>
+      </tt><tt>recvfrom(3, "m", 1, MSG_PEEK, {<font 
color="#ff0000">sa_family=AF_UNSPEC</font>,
+        sa_data="\0\0\0\0\0\0\1\0\0\0\0\0\0\0"}, [16]) = 1</tt><tt><br>
+      </tt><tt>connect(3, {sa_family=AF_UNSPEC,
+        sa_data="\0\0\0\0\0\0\1\0\0\0\0\0\0\0"}, 16) = 0</tt><tt><br>
+      </tt><tt>fcntl(3, F_GETFD)                       = 0</tt><tt><br>
+      </tt><tt>fcntl(3, F_SETFD, FD_CLOEXEC)           = 0</tt><tt><br>
+      </tt><tt>fcntl(3, F_GETFL)                       = 0x2 (flags
+        O_RDWR)</tt><tt><br>
+      </tt><tt>fstat(3, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 
0</tt><tt><br>
+      </tt><tt>mmap(NULL, 4096, PROT_READ|PROT_WRITE,
+        MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0217729000</tt><tt><br>
+      </tt><tt>lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE
+        (Illegal seek)</tt><tt><br>
+      </tt></blockquote>
+    The address family as returned by recvfrom() is AF_UNSPEC,<br>
+    instead of being AF_INET. The connect() call uses this wrong<br>
+    address and things go even more wrongly. Even after reading<br>
+    the man page, I haven't understood why we get AF_UNSPEC.<br>
+    This behaviour may also depend on the configuration of the<br>
+    network on your machine (IPv4 or IPv6 as default). From what<br>
+    I understood, I would say that our problems is the same as<br>
+    the one described here (in the "Answer" section):<br>
+    <br>
+<a class="moz-txt-link-freetext" 
href="http://stackoverflow.com/questions/18108797/recvfrom-not-receiving-depending-on-ai-family-used";>http://stackoverflow.com/questions/18108797/recvfrom-not-receiving-depending-on-ai-family-used</a><br>
+    <br>
+    If you want to see what should happen if everything is fine,<br>
+    replace server.awk and client.awk by similar netcat usage:<br>
+    <br>
+      echo $( date ) | netcat -l -u 8888          # server<br>
+      echo moin | netcat -u localhost 8888    # client<br>
+    <br>
+    strace with netcat will show system calls similar to what gawk does.<br>
+    Hmm, this example shows a slight difference to the<br>
+    client.awk that we use. The "echo moin" of the client is<br>
+    necessary, but the client.awk does not do this.<br>
+    This difference explains what Arnold observed in gawk<br>
+    since 3.1.0.<br>
+    <br>
+    So, the example UDP client code contains a hang.<br>
+    But besides this hang problem there is a different problem<br>
+    with the AF_UNSPEC.<br>
+  </body>
+</html>
+
+--------------030801080701090502000108--
+
+From address@hidden  Sun Mar  6 13:29:16 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id B0A80442
+       for <address@hidden>; Sun,  6 Mar 2016 13:29:16 -0500 (EST)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id A297E6C5; Sun,  6 Mar 2016 13:29:16 -0500 (EST)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 5E0984B
+       for <address@hidden>; Sun,  6 Mar 2016 13:29:15 -0500 (EST)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 5E0984B
+Authentication-Results: sv3.telemetry-investments.com; dmarc=pass 
header.from=gmail.com
+Authentication-Results: sv3.telemetry-investments.com;
+       dkim=pass (2048-bit key) header.d=gmail.com address@hidden 
header.b=MncCGERE
+Received: from localhost ([::1]:51640 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1acdQW-0003XC-Mk
+       for address@hidden; Sun, 06 Mar 2016 13:29:12 -0500
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:49085)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1acdQU-0003Ul-7m
+       for address@hidden; Sun, 06 Mar 2016 13:29:11 -0500
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1acdQR-0000Pl-2v
+       for address@hidden; Sun, 06 Mar 2016 13:29:10 -0500
+Received: from mail-io0-x234.google.com ([2607:f8b0:4001:c06::234]:34471)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1acdQQ-0000PT-VO
+       for address@hidden; Sun, 06 Mar 2016 13:29:07 -0500
+Received: by mail-io0-x234.google.com with SMTP id m184so110570737iof.1
+       for <address@hidden>; Sun, 06 Mar 2016 10:29:06 -0800 (PST)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
+       h=date:from:to:cc:subject:message-id:references:mime-version
+       :content-disposition:content-transfer-encoding:in-reply-to
+       :user-agent; bh=u7hO1hxwFA3IHtw+0exna711t750EnHddhZynjQlii0=;
+       b=MncCGEREhG+Cdhx4JWoTlNqLF23c/8heUayTFsDQneRsEHbU1HU7VNT+Hg58VVKnhq
+       QgEzX8h43xHyZ60dsGOm7cwtzZzc6tybuSdRxSc6x5VatEQBEH7599m+VnNiUMEp/7Cj
+       3/DRkNBnr72mTmAwG8HGx/4d5Gmjzt292Zo50fce05vRJZNChck6heYGjfHtpGIk4WM2
+       LTpy6HsFIbrNpSFduZB44CVKbm7cYiL7AdivYtPUYqs0mmolMPuJWAnstbXLmvCJFA2d
+       X3FPgUQ6Xv1ozJLpCFaCky1FaJky/3MYYL5Djzd1IpX8RLEnrldB6J2tgkpfWTlGTCtI
+       QrjA==
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=1e100.net; s=20130820;
+       h=x-gm-message-state:date:from:to:cc:subject:message-id:references
+       :mime-version:content-disposition:content-transfer-encoding
+       :in-reply-to:user-agent;
+       bh=u7hO1hxwFA3IHtw+0exna711t750EnHddhZynjQlii0=;
+       b=RuDfu46uioIClB2uoxCa95feruKvQVo7HqOHUp3wIJh7k5QLqpolzI1saI8upJebWG
+       tlV54x71KiheXq/ZxvzWXLHBYlcPpa1n/So+9S6QBnOOITasNLRJatnuN28lSEK1qi/d
+       hgWx7cwRcQ95wsSUSVlRexGmXrXmoDnCC8ekMtBEmpDPmlPzeY9ePYtgBoiMYuIyDLUo
+       tOLIXDisi4uK+vEM5szdh/E3Eu612ZETLeu6tkaq5WzN0OWhGsUspdTbVPr4QOwEwnqw
+       h6PFNr/qnP8+kV0n8cS7ig78IkGn3C9Gu5Ax0MxyQe2SNqsAnCGJChyHfM9wOx58+01w
+       didA==
+X-Gm-Message-State: 
AD7BkJIs3KQWYHBJg3KoM+oD2tfif486wHqvqslqdnWLWxfyIUB/QZsRFy6uLkd5SodHJQ==
+X-Received: by 10.107.3.34 with SMTP id 34mr8820297iod.159.1457288946214;
+       Sun, 06 Mar 2016 10:29:06 -0800 (PST)
+Received: from smok.internal (d23-17-121-177.abhsia.telus.net. [23.17.121.177])
+       by smtp.gmail.com with ESMTPSA id l17sm3507503igf.1.2016.03.06.10.29.04
+       (version=TLS1_2 cipher=AES128-SHA bits=128/128);
+       Sun, 06 Mar 2016 10:29:05 -0800 (PST)
+Date: Sun, 6 Mar 2016 11:28:57 -0700
+From: Michal Jaegermann <address@hidden>
+To: =?iso-8859-1?Q?J=FCrgen?= Kahrs <address@hidden>
+Message-ID: <address@hidden>
+References: <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=iso-8859-1
+Content-Disposition: inline
+Content-Transfer-Encoding: 8bit
+In-Reply-To: <address@hidden>
+User-Agent: Mutt/1.5.23 (2014-03-12)
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
+X-Received-From: 2607:f8b0:4001:c06::234
+Cc: address@hidden
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 779
+Lines: 21
+
+On Sun, Mar 06, 2016 at 03:57:41PM +0100, Jürgen Kahrs wrote:
+> 
+> The address family as returned by recvfrom() is AF_UNSPEC,
+> instead of being AF_INET.
+
+'man 3 getaddrinfo', at least on Linux,  says the following:
+
+The value AF_UNSPEC indicates that getaddrinfo() should return socket
+addresses  for any address family (either IPv4 or IPv6, for example) that can
+be used with node and service.
+
+> Even after reading
+> the man page, I haven't understood why we get AF_UNSPEC.
+
+Sockets may have IPv4 addresses, or IPv6, or both; so AF_UNSPEC
+looks correct but it appears that handling that is somewhat more involved
+(like in http://stackoverflow.com/questions/18108797 you are quoting).
+It appears from the net search that the same trouble was bumped into
+many times.
+
+   Michal
+
+From address@hidden  Sun Mar  6 14:22:23 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id 930433DCA
+       for <address@hidden>; Sun,  6 Mar 2016 14:22:23 -0500 (EST)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id 7E1006EF; Sun,  6 Mar 2016 14:22:23 -0500 (EST)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 24A9E6A8
+       for <address@hidden>; Sun,  6 Mar 2016 14:22:22 -0500 (EST)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 24A9E6A8
+Authentication-Results: sv3.telemetry-investments.com; dmarc=none 
header.from=skeeve.com
+Received: from localhost ([::1]:51849 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1aceFv-0004nU-Hf
+       for address@hidden; Sun, 06 Mar 2016 14:22:19 -0500
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:57734)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1aceFt-0004nF-KD
+       for address@hidden; Sun, 06 Mar 2016 14:22:18 -0500
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1aceFq-0002NT-Pm
+       for address@hidden; Sun, 06 Mar 2016 14:22:17 -0500
+Received: from mxout1.netvision.net.il ([194.90.9.20]:64784)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1aceFq-0002NB-IA
+       for address@hidden; Sun, 06 Mar 2016 14:22:14 -0500
+MIME-version: 1.0
+Content-transfer-encoding: 7BIT
+Content-type: text/plain; CHARSET=US-ASCII
+Received: from skeeve.com ([93.173.253.111]) by mxout1.netvision.net.il
+       (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit
+       (built Nov
+       17 2011)) with ESMTPSA id <address@hidden>
+       for address@hidden; Sun, 06 Mar 2016 21:20:25 +0200 (IST)
+Received: from skeeve.com (skeeve.com [127.0.0.1])
+       by skeeve.com (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id
+       u26JKOwq007181; Sun, 06 Mar 2016 21:20:24 +0200
+Received: (from address@hidden)        by skeeve.com (8.14.4/8.14.4/Submit)
+       id u26JKO9h007180; Sun, 06 Mar 2016 21:20:24 +0200
+From: Aharon Robbins <address@hidden>
+Message-id: <address@hidden>
+Date: Sun, 06 Mar 2016 21:20:24 +0200
+To: address@hidden, address@hidden
+References: <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+In-reply-to: <address@hidden>
+User-Agent: Heirloom mailx 12.5 6/20/10
+X-detected-operating-system: by eggs.gnu.org: Solaris 10
+X-Received-From: 194.90.9.20
+Cc: address@hidden
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 123
+Lines: 6
+
+I also tried using /inet4/... in the client and server, and it didn't
+make any difference.  Any idea why?
+
+Thanks,
+
+Arnold
+
+From address@hidden  Sun Mar  6 15:03:23 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id 079A1442
+       for <address@hidden>; Sun,  6 Mar 2016 15:03:23 -0500 (EST)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id E72A36C5; Sun,  6 Mar 2016 15:03:22 -0500 (EST)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id A4AEE461
+       for <address@hidden>; Sun,  6 Mar 2016 15:03:22 -0500 (EST)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com A4AEE461
+Authentication-Results: sv3.telemetry-investments.com; dmarc=pass 
header.from=googlemail.com
+Authentication-Results: sv3.telemetry-investments.com;
+       dkim=pass (2048-bit key) header.d=googlemail.com address@hidden 
header.b=waSQHfxn
+Received: from localhost ([::1]:51957 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1acetd-0004fb-9Z
+       for address@hidden; Sun, 06 Mar 2016 15:03:21 -0500
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:34108)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1acetZ-0004ez-QZ
+       for address@hidden; Sun, 06 Mar 2016 15:03:18 -0500
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1acetV-0000mg-QE
+       for address@hidden; Sun, 06 Mar 2016 15:03:17 -0500
+Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:35052)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1acetV-0000mb-Im
+       for address@hidden; Sun, 06 Mar 2016 15:03:13 -0500
+Received: by mail-wm0-x235.google.com with SMTP id l68so59078275wml.0
+       for <address@hidden>; Sun, 06 Mar 2016 12:03:13 -0800 (PST)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=googlemail.com; s=20120113;
+       h=from:subject:to:references:message-id:date:user-agent:mime-version
+       :in-reply-to:content-transfer-encoding;
+       bh=1dhTPnLMl1NLYTiZ5B3/gUpJCZPbHFlYXmSyglJlsCQ=;
+       b=waSQHfxn0Aeb/6+aCPqQvussc9woWxVJ8Z65zMSkD26kE/kc7QJjF0x1u4bi8xomN/
+       RlnnIHzNC9k507ntNATNqsXt1RdukDOz0g6BbHECv8Vjrnjut1uDl88zmK2gKcOQ0Xal
+       HqWqfjKX74wbvzN4a6i7c2ihTcjaMJcIen9TQlcswvelpMY+V8CqKnEgNdxLK2erLnN8
+       rJuKMvXgsQrYrYfOhqi6Jz7OQEuVOv+39f5CBORYcq7S46+dzr656IUhdNoNueHB384/
+       XN6qYNChVDBkxtQ9ThORTbzlte+NlQne5R2dGEM5Bt8F7btgnp4WX1eUlGtmWnhdlxLP
+       AqBw==
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=1e100.net; s=20130820;
+       h=x-gm-message-state:from:subject:to:references:message-id:date
+       :user-agent:mime-version:in-reply-to:content-transfer-encoding;
+       bh=1dhTPnLMl1NLYTiZ5B3/gUpJCZPbHFlYXmSyglJlsCQ=;
+       b=MpG7lsWt4cPXQoQz8MyQ8utUvkfhsEYJuo6iI1fvs7pmBHf7MzuvuFJ7IACyHDz+gZ
+       ZdWfB6d85ZrDd5zReycLdDA+CPrfvPnWhPYe+H+qkemXSYXz2eL03WSklEuRMQ5z/Q+x
+       ZO74qKHurAmLIj8CpUmwkE6+xfJ9QI0lmlN2x5lfrHo2wIjwOD2qFqRnAXgkKufoS0ye
+       +h2Yb4Swb4/7Q4fJpbXr/w4r3Ay1XCGw69+B3Yj/JQYqdfel+PkQo9WXcXi9HOKloDDr
+       afPng3lSrHmzOl/MKivb+adGOQra5cYrPuWY+hETuL3g4fzLK0qHostNBRC+up6q+F5v
+       zy+Q==
+X-Gm-Message-State: 
AD7BkJL80YXtcXHPQ640xkfw+XIQdHyd1MjNpWmNBzKG/8WvUM8K14LHPSeiViXQprtdxg==
+X-Received: by 10.194.6.234 with SMTP id e10mr19057923wja.118.1457294592575;
+       Sun, 06 Mar 2016 12:03:12 -0800 (PST)
+Received: from [192.168.0.11] (ip5f5ac802.dynamic.kabel-deutschland.de.
+       [95.90.200.2]) by smtp.googlemail.com with ESMTPSA id
+       73sm10167939wmy.22.2016.03.06.12.03.11 for <address@hidden>
+       (version=TLSv1/SSLv3 cipher=OTHER);
+       Sun, 06 Mar 2016 12:03:12 -0800 (PST)
+From: "=?UTF-8?Q?J=c3=bcrgen_Kahrs?=" <address@hidden>
+X-Google-Original-From: =?UTF-8?Q?J=c3=bcrgen_Kahrs?=
+       <address@hidden>
+To: address@hidden
+References: <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+Message-ID: <address@hidden>
+Date: Sun, 6 Mar 2016 21:03:11 +0100
+User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
+       Thunderbird/38.6.0
+MIME-Version: 1.0
+In-Reply-To: <address@hidden>
+Content-Type: text/plain; charset=windows-1252
+Content-Transfer-Encoding: 7bit
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
+X-Received-From: 2a00:1450:400c:c09::235
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 260
+Lines: 7
+
+Am 06.03.2016 um 20:20 schrieb Aharon Robbins:
+> I also tried using /inet4/... in the client and server, and it didn't
+> make any difference.  Any idea why?
+
+I also played a bit with inet4 and it did not help.
+It must be getaddrinfo() that returns AF_UNSPEC.
+
+
+From address@hidden  Sun Mar  6 14:22:23 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id 858FD426
+       for <address@hidden>; Sun,  6 Mar 2016 14:22:23 -0500 (EST)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id 799F06CD; Sun,  6 Mar 2016 14:22:23 -0500 (EST)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 38A3C6C5
+       for <address@hidden>; Sun,  6 Mar 2016 14:22:22 -0500 (EST)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 38A3C6C5
+Authentication-Results: sv3.telemetry-investments.com; dmarc=none 
header.from=skeeve.com
+Received: from localhost ([::1]:51848 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1aceFv-0004nQ-GC
+       for address@hidden; Sun, 06 Mar 2016 14:22:19 -0500
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:57735)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1aceFt-0004nG-K8
+       for address@hidden; Sun, 06 Mar 2016 14:22:18 -0500
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1aceFq-0002NN-FK
+       for address@hidden; Sun, 06 Mar 2016 14:22:17 -0500
+Received: from mxout1.netvision.net.il ([194.90.9.20]:64784)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1aceFq-0002NB-7h
+       for address@hidden; Sun, 06 Mar 2016 14:22:14 -0500
+MIME-version: 1.0
+Content-transfer-encoding: 7BIT
+Content-type: text/plain; CHARSET=US-ASCII
+Received: from skeeve.com ([93.173.253.111]) by mxout1.netvision.net.il
+       (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit
+       (built Nov
+       17 2011)) with ESMTPSA id <address@hidden>
+       for address@hidden; Sun, 06 Mar 2016 21:17:25 +0200 (IST)
+Received: from skeeve.com (skeeve.com [127.0.0.1])
+       by skeeve.com (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id
+       u26JHN0E006987; Sun, 06 Mar 2016 21:17:23 +0200
+Received: (from address@hidden)        by skeeve.com (8.14.4/8.14.4/Submit)
+       id u26JHNwQ006986; Sun, 06 Mar 2016 21:17:23 +0200
+From: Aharon Robbins <address@hidden>
+Message-id: <address@hidden>
+Date: Sun, 06 Mar 2016 21:17:23 +0200
+To: address@hidden, address@hidden
+References: <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+In-reply-to: <address@hidden>
+User-Agent: Heirloom mailx 12.5 6/20/10
+X-detected-operating-system: by eggs.gnu.org: Solaris 10
+X-Received-From: 194.90.9.20
+Cc: address@hidden
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 193
+Lines: 9
+
+Can anyone get the original code to work? I tried compiling 3.1.0
+and I get the same hangs.
+
+I don't mind trying to fix the logic, but I need to know what the
+right steps are.
+
+Thanks,
+
+Arnold
+
+From address@hidden  Sun Mar  6 14:54:48 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id 70D2F442
+       for <address@hidden>; Sun,  6 Mar 2016 14:54:48 -0500 (EST)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id 5EB176C5; Sun,  6 Mar 2016 14:54:48 -0500 (EST)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 1AA94461
+       for <address@hidden>; Sun,  6 Mar 2016 14:54:47 -0500 (EST)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 1AA94461
+Authentication-Results: sv3.telemetry-investments.com; dmarc=pass 
header.from=googlemail.com
+Authentication-Results: sv3.telemetry-investments.com;
+       dkim=pass (2048-bit key) header.d=googlemail.com address@hidden 
header.b=zcso3Y88
+Received: from localhost ([::1]:51926 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1acelK-00027b-Aw
+       for address@hidden; Sun, 06 Mar 2016 14:54:46 -0500
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:32960)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1acelH-00027S-HQ
+       for address@hidden; Sun, 06 Mar 2016 14:54:44 -0500
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1acelC-0007XY-UN
+       for address@hidden; Sun, 06 Mar 2016 14:54:43 -0500
+Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:34190)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1acelC-0007XU-JZ
+       for address@hidden; Sun, 06 Mar 2016 14:54:38 -0500
+Received: by mail-wm0-x22a.google.com with SMTP id p65so83441359wmp.1
+       for <address@hidden>; Sun, 06 Mar 2016 11:54:38 -0800 (PST)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=googlemail.com; s=20120113;
+       h=from:subject:references:to:message-id:date:user-agent:mime-version
+       :in-reply-to; bh=jpN7MlA2J8WKgCBtEd0/SINODoMoXu4ex9MgN7ulKUY=;
+       b=zcso3Y88tDMyady9rMHk3stN+rwENwtdK/+VdolRUaUQtkbg0K5M/UcHzeRGydBToM
+       bHALlRA1z0KzCcl6PQ7gww7S0ACEqzcK9YJU6l0EYD2B/yRxdgP7MMk016x+JMWKHhc9
+       y9zPKARj9U0Cd+miCR7q7g/rX8P4SQP8Ynx/J1Edf77Et5SPTGRbmIDdymtcf4fqv/rW
+       QCoB/3trZuX0nDtXF5Np7EfvJQN+ggE5ajtZYUZyRfLNH1OSC32TWLpRjolfxPiwi5XR
+       /5MEjBrytpxW7tCo/XiGUMFVXlVR0m2RUE3LugkwQ/f4nVNwzfrMQiZHR4huh55TIqSC
+       mdBA==
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=1e100.net; s=20130820;
+       h=x-gm-message-state:from:subject:references:to:message-id:date
+       :user-agent:mime-version:in-reply-to;
+       bh=jpN7MlA2J8WKgCBtEd0/SINODoMoXu4ex9MgN7ulKUY=;
+       b=k1KJcn+zjpYBUTvJdaYRmiZfrky7aCvHDe5IW4v2jNvpSAgJ/RtZo+o211GIV9vr/x
+       lwZkfihSpbdA5ZBU1SIga0P9/cz/TTtYx5d7vON+3t/RdavgFmKiH47aUcxFb84MTnDh
+       brDPOi5t6YWeZ2+QwgCTohkp47El7WeNGMyD+HQnY4jbpA5K3tyNTuKhIRQA2a11GZJJ
+       5Ai5JYolH0/wKvYeKV4VKEBG2VvetDcLCLTpEInVODmGXAFicQU/FLGCRK0oPDeZtZSX
+       2v2WQrcL2WkriElF+RxNKouq3lHc0vfn6nKBAxvl05hV/1PT8Foe7stT+IsUp31zNebT
+       YcTQ==
+X-Gm-Message-State: 
AD7BkJIs3yCk7zUgF2tESIDoQmgeve5dy71E5VdiTQ24MMQiRn76ydMgpIvVjhrEhzOIXw==
+X-Received: by 10.28.125.195 with SMTP id y186mr4027672wmc.79.1457294077813;
+       Sun, 06 Mar 2016 11:54:37 -0800 (PST)
+Received: from [192.168.0.11] (ip5f5ac802.dynamic.kabel-deutschland.de.
+       [95.90.200.2]) by smtp.googlemail.com with ESMTPSA id
+       c71sm114480wmd.4.2016.03.06.11.54.36 for <address@hidden>
+       (version=TLSv1/SSLv3 cipher=OTHER);
+       Sun, 06 Mar 2016 11:54:37 -0800 (PST)
+From: "=?UTF-8?Q?J=c3=bcrgen_Kahrs?=" <address@hidden>
+X-Google-Original-From: =?UTF-8?Q?J=c3=bcrgen_Kahrs?=
+       <address@hidden>
+References: <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+To: address@hidden
+Message-ID: <address@hidden>
+Date: Sun, 6 Mar 2016 20:54:35 +0100
+User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
+       Thunderbird/38.6.0
+MIME-Version: 1.0
+In-Reply-To: <address@hidden>
+Content-Type: multipart/alternative;
+       boundary="------------000000090503030309040109"
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
+X-Received-From: 2a00:1450:400c:c09::22a
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 5130
+Lines: 128
+
+This is a multi-part message in MIME format.
+--------------000000090503030309040109
+Content-Type: text/plain; charset=windows-1252
+Content-Transfer-Encoding: 7bit
+
+Am 06.03.2016 um 20:17 schrieb Aharon Robbins:
+> Can anyone get the original code to work? I tried compiling 3.1.0
+> and I get the same hangs.
+
+I tried http://ftp.gnu.org/gnu/gawk/gawk-3.1.0.tar.gz
+but couldnt build because the "configure" script hangs
+in check of mktime.
+
+I tried http://ftp.gnu.org/gnu/gawk/gawk-3.1.8.tar.gz
+and it built.
+
+The behaviour of the server example is similar (hangs)
+but there is a slight difference:
+
+    socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 3
+    bind(3, {sa_family=AF_INET, sin_port=htons(8888), 
sin_addr=inet_addr("0.0.0.0")}, 16) = 0
+    recvfrom(3, "m", 1, MSG_PEEK, {sa_family=AF_INET, sin_port=htons(57669), 
sin_addr=inet_addr("127.0.0.1")}, [16]) = 1
+    connect(3, {sa_family=AF_INET, sin_port=htons(57669), 
sin_addr=inet_addr("127.0.0.1")}, 16) = 0
+    fstat(3, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
+    fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
+    fcntl(3, F_GETFL)                       = 0x2 (flags O_RDWR)
+
+
+So the problem with the AF_UNSPEC did not appear
+in gawk 3.1.8. The server script can send its string
+to a client (I used the netcat client). The client did
+receive the string. But the server script was unable
+to terminate properly.
+
+    fstat(3, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
+    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7fd1d4190000
+    lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
+
+This illegal seek also appears when gawk is built from
+the current master.
+
+
+> I don't mind trying to fix the logic, but I need to know what the
+> right steps are.
+
+It looks like 3 bugs:
+1. Handling of AF_UNSPEC (correct in 3.1.8, wrong in master)
+2. illegal seek (appears in both)
+3. client script behaviour wrong in both
+
+
+
+--------------000000090503030309040109
+Content-Type: text/html; charset=windows-1252
+Content-Transfer-Encoding: 8bit
+
+<html>
+  <head>
+    <meta content="text/html; charset=windows-1252"
+      http-equiv="Content-Type">
+  </head>
+  <body bgcolor="#FFFFFF" text="#000000">
+    <div class="moz-cite-prefix">Am 06.03.2016 um 20:17 schrieb Aharon
+      Robbins:<br>
+    </div>
+    <blockquote cite="mid:address@hidden"
+      type="cite">
+      <pre wrap="">Can anyone get the original code to work? I tried compiling 
3.1.0
+and I get the same hangs.</pre>
+    </blockquote>
+    <br>
+    I tried <a class="moz-txt-link-freetext" 
href="http://ftp.gnu.org/gnu/gawk/gawk-3.1.0.tar.gz";>http://ftp.gnu.org/gnu/gawk/gawk-3.1.0.tar.gz</a><br>
+    but couldnt build because the "configure" script hangs<br>
+    in check of mktime.<br>
+    <br>
+    I tried <a class="moz-txt-link-freetext" 
href="http://ftp.gnu.org/gnu/gawk/gawk-3.1.8.tar.gz";>http://ftp.gnu.org/gnu/gawk/gawk-3.1.8.tar.gz</a><br>
+    and it built.<br>
+    <br>
+    The behaviour of the server example is similar (hangs)<br>
+    but there is a slight difference:<br>
+    <br>
+    <blockquote><tt>socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 3</tt><tt><br>
+      </tt><tt>bind(3, {sa_family=AF_INET, sin_port=htons(8888),
+        sin_addr=inet_addr("0.0.0.0")}, 16) = 0</tt><tt><br>
+      </tt><tt>recvfrom(3, "m", 1, MSG_PEEK, {<font 
color="#ff0000">sa_family=AF_INET</font>,
+        sin_port=htons(57669), sin_addr=inet_addr("127.0.0.1")}, [16]) =
+        1</tt><tt><br>
+      </tt><tt>connect(3, {sa_family=AF_INET, sin_port=htons(57669),
+        sin_addr=inet_addr("127.0.0.1")}, 16) = 0</tt><tt><br>
+      </tt><tt>fstat(3, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 
0</tt><tt><br>
+      </tt><tt>fcntl(3, F_SETFD, FD_CLOEXEC)           = 0</tt><tt><br>
+      </tt><tt>fcntl(3, F_GETFL)                       = 0x2 (flags
+        O_RDWR)</tt><tt><br>
+      </tt></blockquote>
+    <br>
+    So the problem with the AF_UNSPEC did not appear<br>
+    in gawk 3.1.8. The server script can send its string<br>
+    to a client (I used the netcat client). The client did<br>
+    receive the string. But the server script was unable<br>
+    to terminate properly.<br>
+    <blockquote><tt>fstat(3, {st_mode=S_IFSOCK|0777, st_size=0, ...}) =
+        0</tt><tt><br>
+      </tt><tt>mmap(NULL, 4096, PROT_READ|PROT_WRITE,
+        MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fd1d4190000</tt><tt><br>
+      </tt><tt>lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE (<font
+          color="#ff0000">Illegal seek</font>)</tt><tt><br>
+      </tt></blockquote>
+    This illegal seek also appears when gawk is built from<br>
+    the current master.<br>
+    <br>
+    <br>
+    <blockquote cite="mid:address@hidden"
+      type="cite">
+      <pre wrap="">I don't mind trying to fix the logic, but I need to know 
what the
+right steps are.
+</pre>
+    </blockquote>
+    <br>
+    It looks like 3 bugs:<br>
+    1. Handling of AF_UNSPEC (correct in 3.1.8, wrong in master)<br>
+    2. illegal seek (appears in both)<br>
+    3. client script behaviour wrong in both<br>
+    <br>
+    <br>
+  </body>
+</html>
+
+--------------000000090503030309040109--
+
+From address@hidden  Sun Mar 13 10:28:36 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id D97D1311
+       for <address@hidden>; Sun, 13 Mar 2016 10:28:36 -0400 (EDT)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id CC0BB6B1; Sun, 13 Mar 2016 10:28:36 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 70FE7598
+       for <address@hidden>; Sun, 13 Mar 2016 10:28:36 -0400 (EDT)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 70FE7598
+Authentication-Results: sv3.telemetry-investments.com; dmarc=pass 
header.from=googlemail.com
+Authentication-Results: sv3.telemetry-investments.com;
+       dkim=pass (2048-bit key) header.d=googlemail.com address@hidden 
header.b=sa5CGyXS
+Received: from localhost ([::1]:36235 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1af70U-0002U7-9W
+       for address@hidden; Sun, 13 Mar 2016 10:28:34 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:34746)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1af70R-0002Tv-HI
+       for address@hidden; Sun, 13 Mar 2016 10:28:32 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1af70M-0006uN-Sf
+       for address@hidden; Sun, 13 Mar 2016 10:28:31 -0400
+Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:37005)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1af70M-0006u8-HP
+       for address@hidden; Sun, 13 Mar 2016 10:28:26 -0400
+Received: by mail-wm0-x229.google.com with SMTP id p65so72040532wmp.0
+       for <address@hidden>; Sun, 13 Mar 2016 07:28:25 -0700 (PDT)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=googlemail.com; s=20120113;
+       h=from:subject:to:references:message-id:date:user-agent:mime-version
+       :in-reply-to; bh=Mp1jzavGOjR15owakdQhLm0d9FnPYEbkWWB91yOS6E8=;
+       b=sa5CGyXSYND4iUdbXcvZcDy1vPIQv+GzxlVIX6X02eq+Mhe4NHEycUyprkpCDT6jTi
+       adz3vnM0hP4UH+k3ZUdHoDcSS2ob4HOGTfA9LQmAHV7m0lLRZxYjWbu2ufi/OQyhDhDH
+       Nub30ogM6ek6S9VQgUwXVAR3PMyDKpntIfqpncHiAgA80FE9XgFdo8HMaMkJcUcydIfs
+       0ED5NZmhudhU9DTx7VPrtUu1BXXFjoSr1BiZYn81/atQ1k+PjIenRqKwpCxVYAw85uYC
+       IKTz38sCM/q6hUvqkLyOLa9MZy8ngVKVVxoSpRDHF7d9xnq/CGZlGiUWSUtCJRU8U/yA
+       ortg==
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=1e100.net; s=20130820;
+       h=x-gm-message-state:from:subject:to:references:message-id:date
+       :user-agent:mime-version:in-reply-to;
+       bh=Mp1jzavGOjR15owakdQhLm0d9FnPYEbkWWB91yOS6E8=;
+       b=klAX1y/tXBvy+VHTPK44TdnTBYdoi4ZMrhjETzGAGP7p5/bCiKZAm/nXtHSRPyUcJD
+       9CYz9ZgbwxWMDDyZ/tnb6S5qekAAbpZ8nqNLvmAdk++rFem1mPVK1CXW0jwNcx5PnFSj
+       HKOJrxYEj9fjLKbQefhv63DAthTb0s+K/xnVKYzHjLCHYDTtH3DjDA/YqbLXgxZvK6bd
+       pnU1yKwhC1MdAsKjxeJYvJxR3tB8v2p6Su3D+lhl7gp+Zr3nH5d8zZpXQQ+p+fxXRjrd
+       2j2w9M+jCKO0zcErKbIWi87aTh0E4XqW8bLvRriFuzfk3Ir01486pg33djhNWkmHA07d
+       5uDA==
+X-Gm-Message-State: 
AD7BkJI+d/7J4mUjuSXimhVoI7r5BQK5z362MAZyr1EqDZnjK7ekJ6opBOh+4ZGwzRn8Zw==
+X-Received: by 10.28.68.136 with SMTP id r130mr7983385wma.28.1457879304432;
+       Sun, 13 Mar 2016 07:28:24 -0700 (PDT)
+Received: from [192.168.0.11] (ip5f5ac869.dynamic.kabel-deutschland.de.
+       [95.90.200.105]) by smtp.googlemail.com with ESMTPSA id
+       d2sm17891811wjf.28.2016.03.13.07.28.23 for <address@hidden>
+       (version=TLSv1/SSLv3 cipher=OTHER);
+       Sun, 13 Mar 2016 07:28:23 -0700 (PDT)
+From: "=?UTF-8?Q?J=c3=bcrgen_Kahrs?=" <address@hidden>
+X-Google-Original-From: =?UTF-8?Q?J=c3=bcrgen_Kahrs?=
+       <address@hidden>
+To: address@hidden
+References: <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+Message-ID: <address@hidden>
+Date: Sun, 13 Mar 2016 15:28:22 +0100
+User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
+       Thunderbird/38.6.0
+MIME-Version: 1.0
+In-Reply-To: <address@hidden>
+Content-Type: multipart/alternative;
+       boundary="------------010903030700010703010304"
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
+X-Received-From: 2a00:1450:400c:c09::229
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 7941
+Lines: 189
+
+This is a multi-part message in MIME format.
+--------------010903030700010703010304
+Content-Type: text/plain; charset=windows-1252
+Content-Transfer-Encoding: 8bit
+
+Am 06.03.2016 um 20:54 schrieb Jürgen Kahrs:
+> Am 06.03.2016 um 20:17 schrieb Aharon Robbins:
+>> Can anyone get the original code to work? I tried compiling 3.1.0
+>> and I get the same hangs.
+>
+> I tried http://ftp.gnu.org/gnu/gawk/gawk-3.1.0.tar.gz
+> but couldnt build because the "configure" script hangs
+> in check of mktime.
+>
+> I tried http://ftp.gnu.org/gnu/gawk/gawk-3.1.8.tar.gz
+> and it built.
+>
+> The behaviour of the server example is similar (hangs)
+> but there is a slight difference:
+>
+>     socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 3
+>     bind(3, {sa_family=AF_INET, sin_port=htons(8888), 
sin_addr=inet_addr("0.0.0.0")}, 16) = 0
+>     recvfrom(3, "m", 1, MSG_PEEK, {sa_family=AF_INET, sin_port=htons(57669), 
sin_addr=inet_addr("127.0.0.1")}, [16]) = 1
+>     connect(3, {sa_family=AF_INET, sin_port=htons(57669), 
sin_addr=inet_addr("127.0.0.1")}, 16) = 0
+>     fstat(3, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
+>     fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
+>     fcntl(3, F_GETFL)                       = 0x2 (flags O_RDWR)
+>
+>
+> So the problem with the AF_UNSPEC did not appear
+> in gawk 3.1.8. The server script can send its string
+> to a client (I used the netcat client). The client did
+> receive the string. But the server script was unable
+> to terminate properly.
+
+I have found a way to change the behaviour of the  GAWK master
+source code so that it behaves again in the same (correct) way as
+described above for GAWK 3.1.8:
+
+    --- a/io.c
+    +++ b/io.c
+    @@ -1593,7 +1593,7 @@ socketopen(int family, int type, const char 
*localpname,
+     #ifdef MSG_PEEK
+                                            char buf[10];
+                                            struct sockaddr_storage 
remote_addr;
+    -                                       socklen_t read_len = 0;
+    +                                       socklen_t read_len = sizeof 
remote_addr;
+
+
+recvfrom() was unable to pass the remote address only
+because read_len was 0. It was a bit frustrating that such
+a detail was silently ignored in the past and causes problems
+in the more recent OS installations.
+
+The other 2 problems that I listed below are still open.
+
+>     fstat(3, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
+>     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) 
= 0x7fd1d4190000
+>     lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
+>
+> This illegal seek also appears when gawk is built from
+> the current master.
+>
+>
+>> I don't mind trying to fix the logic, but I need to know what the
+>> right steps are.
+>
+> It looks like 3 bugs:
+> 1. Handling of AF_UNSPEC (correct in 3.1.8, wrong in master)
+> 2. illegal seek (appears in both)
+> 3. client script behaviour wrong in both
+>
+>
+
+
+--------------010903030700010703010304
+Content-Type: text/html; charset=windows-1252
+Content-Transfer-Encoding: 8bit
+
+<html>
+  <head>
+    <meta content="text/html; charset=windows-1252"
+      http-equiv="Content-Type">
+  </head>
+  <body bgcolor="#FFFFFF" text="#000000">
+    <div class="moz-cite-prefix">Am 06.03.2016 um 20:54 schrieb Jürgen
+      Kahrs:<br>
+    </div>
+    <blockquote cite="mid:address@hidden" type="cite">
+      <meta content="text/html; charset=windows-1252"
+        http-equiv="Content-Type">
+      <div class="moz-cite-prefix">Am 06.03.2016 um 20:17 schrieb Aharon
+        Robbins:<br>
+      </div>
+      <blockquote cite="mid:address@hidden"
+        type="cite">
+        <pre wrap="">Can anyone get the original code to work? I tried 
compiling 3.1.0
+and I get the same hangs.</pre>
+      </blockquote>
+      <br>
+      I tried <a moz-do-not-send="true" class="moz-txt-link-freetext"
+        
href="http://ftp.gnu.org/gnu/gawk/gawk-3.1.0.tar.gz";>http://ftp.gnu.org/gnu/gawk/gawk-3.1.0.tar.gz</a><br>
+      but couldnt build because the "configure" script hangs<br>
+      in check of mktime.<br>
+      <br>
+      I tried <a moz-do-not-send="true" class="moz-txt-link-freetext"
+        
href="http://ftp.gnu.org/gnu/gawk/gawk-3.1.8.tar.gz";>http://ftp.gnu.org/gnu/gawk/gawk-3.1.8.tar.gz</a><br>
+      and it built.<br>
+      <br>
+      The behaviour of the server example is similar (hangs)<br>
+      but there is a slight difference:<br>
+      <br>
+      <blockquote><tt>socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 3</tt><tt><br>
+        </tt><tt>bind(3, {sa_family=AF_INET, sin_port=htons(8888),
+          sin_addr=inet_addr("0.0.0.0")}, 16) = 0</tt><tt><br>
+        </tt><tt>recvfrom(3, "m", 1, MSG_PEEK, {<font 
color="#ff0000">sa_family=AF_INET</font>,
+          sin_port=htons(57669), sin_addr=inet_addr("127.0.0.1")}, [16])
+          = 1</tt><tt><br>
+        </tt><tt>connect(3, {sa_family=AF_INET, sin_port=htons(57669),
+          sin_addr=inet_addr("127.0.0.1")}, 16) = 0</tt><tt><br>
+        </tt><tt>fstat(3, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 
0</tt><tt><br>
+        </tt><tt>fcntl(3, F_SETFD, FD_CLOEXEC)           = 0</tt><tt><br>
+        </tt><tt>fcntl(3, F_GETFL)                       = 0x2 (flags
+          O_RDWR)</tt><tt><br>
+        </tt></blockquote>
+      <br>
+      So the problem with the AF_UNSPEC did not appear<br>
+      in gawk 3.1.8. The server script can send its string<br>
+      to a client (I used the netcat client). The client did<br>
+      receive the string. But the server script was unable<br>
+      to terminate properly.<br>
+    </blockquote>
+    <br>
+    I have found a way to change the behaviour of the  GAWK master<br>
+    source code so that it behaves again in the same (correct) way as<br>
+    described above for GAWK 3.1.8:<br>
+    <br>
+    <blockquote><tt>--- a/io.c</tt><tt><br>
+      </tt><tt>+++ b/io.c</tt><tt><br>
+      </tt><tt>@@ -1593,7 +1593,7 @@ socketopen(int family, int type,
+        const char *localpname,</tt><tt><br>
+      </tt><tt> #ifdef MSG_PEEK</tt><tt><br>
+      </tt><tt>                                        char 
buf[10];</tt><tt><br>
+      </tt><tt>                                        struct
+        sockaddr_storage remote_addr;</tt><tt><br>
+      </tt><tt>-                                       socklen_t
+        read_len = <font color="#ff0000">0</font>;</tt><tt><br>
+      </tt><tt>+                                       socklen_t
+        read_len = <font color="#33ff33">sizeof 
remote_addr</font>;</tt><tt><br>
+      </tt></blockquote>
+    <br>
+    recvfrom() was unable to pass the remote address only<br>
+    because read_len was 0. It was a bit frustrating that such<br>
+    a detail was silently ignored in the past and causes problems<br>
+    in the more recent OS installations.<br>
+    <br>
+    The other 2 problems that I listed below are still open.<br>
+    <br>
+    <blockquote cite="mid:address@hidden" type="cite">
+      <blockquote><tt>fstat(3, {st_mode=S_IFSOCK|0777, st_size=0, ...})
+          = 0</tt><tt><br>
+        </tt><tt>mmap(NULL, 4096, PROT_READ|PROT_WRITE,
+          MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fd1d4190000</tt><tt><br>
+        </tt><tt>lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE (<font
+            color="#ff0000">Illegal seek</font>)</tt><tt><br>
+        </tt></blockquote>
+      This illegal seek also appears when gawk is built from<br>
+      the current master.<br>
+      <br>
+      <br>
+      <blockquote cite="mid:address@hidden"
+        type="cite">
+        <pre wrap="">I don't mind trying to fix the logic, but I need to know 
what the
+right steps are.
+</pre>
+      </blockquote>
+      <br>
+      It looks like 3 bugs:<br>
+      1. Handling of AF_UNSPEC (correct in 3.1.8, wrong in master)<br>
+      2. illegal seek (appears in both)<br>
+      3. client script behaviour wrong in both<br>
+      <br>
+      <br>
+    </blockquote>
+    <br>
+  </body>
+</html>
+
+--------------010903030700010703010304--
+
+From address@hidden  Sun Mar 13 12:15:25 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id 55EBB311
+       for <address@hidden>; Sun, 13 Mar 2016 12:15:25 -0400 (EDT)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id 4CEA16B1; Sun, 13 Mar 2016 12:15:25 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id E61BC5A6
+       for <address@hidden>; Sun, 13 Mar 2016 12:15:24 -0400 (EDT)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com E61BC5A6
+Authentication-Results: sv3.telemetry-investments.com; dmarc=pass 
header.from=googlemail.com
+Authentication-Results: sv3.telemetry-investments.com;
+       dkim=pass (2048-bit key) header.d=googlemail.com address@hidden 
header.b=nWZaeqES
+Received: from localhost ([::1]:36700 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1af8fq-0003kR-Ba
+       for address@hidden; Sun, 13 Mar 2016 12:15:22 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:53939)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1af8fn-0003kL-M9
+       for address@hidden; Sun, 13 Mar 2016 12:15:20 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1af8fk-0006Bg-FM
+       for address@hidden; Sun, 13 Mar 2016 12:15:19 -0400
+Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:37423)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1af8fk-0006BY-4H
+       for address@hidden; Sun, 13 Mar 2016 12:15:16 -0400
+Received: by mail-wm0-x232.google.com with SMTP id p65so73858059wmp.0
+       for <address@hidden>; Sun, 13 Mar 2016 09:15:15 -0700 (PDT)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=googlemail.com; s=20120113;
+       h=from:subject:to:references:message-id:date:user-agent:mime-version
+       :in-reply-to; bh=cI8tjWDQ/HDB9ajijBueVDNr0tDm1RHPIWYRjJDlMac=;
+       b=nWZaeqESMIvwct2+WdyV6tnOiCGg0RReMzx3qiE7twqQg8isNnUPtLtHGzXEVGLBWi
+       EefMRvL/F1n/eFXFFAgpzZlt9DJsvmgwQULNxHtf9Ke6sI4ixQHMD4BLxUyKcrKX6BA7
+       oNw78tMUnxCSDfdu9f1bbxn6c/4KcBzzBdd1hZEMCk1FFP5prMMQjIjnYWMaXAC/mu7+
+       aWokaSffVmAYQCvgAM244Ny1B7Bcc0SNISX6qTNeg/se0b7+fvlbRq1oGbaueTkELg7u
+       mFpobz0y2Add3KbWyHgeUTZIZiXkm227LbCoNYJiGxY6/PIW3fziUMEU9hH+AhlWE8Ow
+       knlw==
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=1e100.net; s=20130820;
+       h=x-gm-message-state:from:subject:to:references:message-id:date
+       :user-agent:mime-version:in-reply-to;
+       bh=cI8tjWDQ/HDB9ajijBueVDNr0tDm1RHPIWYRjJDlMac=;
+       b=WPjytpY9VH9K8raInLQsaJudA5UPMFuwNshHE0R7qDuO6/q0Ty6zf0dGqwkqGkEgSR
+       cZ6aWQxflRqQkB+EXJTSFkeZG3FCDDavDC8AhPwWWKxX20O+63E7PanW4snxN5QVMvdq
+       bkKILhuRbj0Rp6Hf/Xzyx9HIg8juEOJbnebzxqchxPAbgKdOiuIOlVN29labxaC7VbnM
+       DVvymfMea6eWhDrMLtjBcbixxRmF42NJKmJ+LrGx7b+EE6i64F90CE4dVMp4LjDqHVhI
+       YB5+TAcrC2WTuhypi4+cMa1YLdUilpQkIErh4gmSItSmqsp72Sg8cmVL4hzJm2/h0XSm
+       kgTA==
+X-Gm-Message-State: 
AD7BkJKDYKA52+Z/FmSx7C1XTym1Rw9UZ3roh0/SO8Q5B8j5KP2/4zcaFL2NFfeEffLkBw==
+X-Received: by 10.28.178.209 with SMTP id b200mr13351098wmf.98.1457885715294; 
+       Sun, 13 Mar 2016 09:15:15 -0700 (PDT)
+Received: from [192.168.0.11] (ip5f5ac869.dynamic.kabel-deutschland.de.
+       [95.90.200.105]) by smtp.googlemail.com with ESMTPSA id
+       hh8sm18186673wjc.42.2016.03.13.09.15.14 for <address@hidden>
+       (version=TLSv1/SSLv3 cipher=OTHER);
+       Sun, 13 Mar 2016 09:15:14 -0700 (PDT)
+From: "=?UTF-8?Q?J=c3=bcrgen_Kahrs?=" <address@hidden>
+X-Google-Original-From: =?UTF-8?Q?J=c3=bcrgen_Kahrs?=
+       <address@hidden>
+To: address@hidden
+References: <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+Message-ID: <address@hidden>
+Date: Sun, 13 Mar 2016 17:15:11 +0100
+User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
+       Thunderbird/38.6.0
+MIME-Version: 1.0
+In-Reply-To: <address@hidden>
+Content-Type: multipart/alternative;
+       boundary="------------030404060803030609050400"
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
+X-Received-From: 2a00:1450:400c:c09::232
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 4374
+Lines: 135
+
+This is a multi-part message in MIME format.
+--------------030404060803030609050400
+Content-Type: text/plain; charset=windows-1252
+Content-Transfer-Encoding: 8bit
+
+Am 06.03.2016 um 20:54 schrieb Jürgen Kahrs:
+>
+>     fstat(3, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
+>     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) 
= 0x7fd1d4190000
+>     lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
+>
+> This illegal seek also appears when gawk is built from
+> the current master.
+
+The illegal seek seems to cause no damage.
+It happens in io.c two_way_open:
+
+    rp->output.fp = fdopen(fd, binmode("wb"));
+
+Is it necessary and worth the effort to avoid
+the illegal seek ? I don't know.
+
+>
+>
+>> I don't mind trying to fix the logic, but I need to know what the
+>> right steps are.
+>
+> It looks like 3 bugs:
+> 1. Handling of AF_UNSPEC (correct in 3.1.8, wrong in master)
+
+Solved, see previous posting.
+
+> 2. illegal seek (appears in both)
+
+Can probably be ignored.
+
+> 3. client script behaviour wrong in both
+
+A modification of the UDP client solves this problem:
+
+    # Client
+    BEGIN {
+      print "moin" |& "/inet/udp/0/localhost/8888"
+      "/inet/udp/0/localhost/8888" |& getline
+      print $0
+      close("/inet/udp/0/localhost/8888")
+    }
+
+
+The difference is in the very first print command.
+I am not really happy with this behaviour (because
+it is different from the equivalent TCP client) but it
+works.
+
+
+--------------030404060803030609050400
+Content-Type: text/html; charset=windows-1252
+Content-Transfer-Encoding: 8bit
+
+<html>
+  <head>
+    <meta content="text/html; charset=windows-1252"
+      http-equiv="Content-Type">
+  </head>
+  <body bgcolor="#FFFFFF" text="#000000">
+    <div class="moz-cite-prefix">Am 06.03.2016 um 20:54 schrieb Jürgen
+      Kahrs:<br>
+    </div>
+    <blockquote cite="mid:address@hidden" type="cite">
+      <meta content="text/html; charset=windows-1252"
+        http-equiv="Content-Type">
+      <br>
+      <blockquote><tt>fstat(3, {st_mode=S_IFSOCK|0777, st_size=0, ...})
+          = 0</tt><tt><br>
+        </tt><tt>mmap(NULL, 4096, PROT_READ|PROT_WRITE,
+          MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fd1d4190000</tt><tt><br>
+        </tt><tt>lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE (<font
+            color="#ff0000">Illegal seek</font>)</tt><tt><br>
+        </tt></blockquote>
+      This illegal seek also appears when gawk is built from<br>
+      the current master.<br>
+    </blockquote>
+    <br>
+    The illegal seek seems to cause no damage.<br>
+    It happens in io.c two_way_open: <br>
+    <br>
+    <blockquote><tt>rp-&gt;output.fp = fdopen(fd, binmode("wb"));</tt><tt><br>
+      </tt></blockquote>
+    Is it necessary and worth the effort to avoid<br>
+    the illegal seek ? I don't know.<br>
+    <br>
+    <blockquote cite="mid:address@hidden" type="cite"> <br>
+      <br>
+      <blockquote cite="mid:address@hidden"
+        type="cite">
+        <pre wrap="">I don't mind trying to fix the logic, but I need to know 
what the
+right steps are.
+</pre>
+      </blockquote>
+      <br>
+      It looks like 3 bugs:<br>
+      1. Handling of AF_UNSPEC (correct in 3.1.8, wrong in master)<br>
+    </blockquote>
+    <br>
+    Solved, see previous posting.<br>
+    <br>
+    <blockquote cite="mid:address@hidden" type="cite"> 2.
+      illegal seek (appears in both)<br>
+    </blockquote>
+    <br>
+    Can probably be ignored.<br>
+    <br>
+    <blockquote cite="mid:address@hidden" type="cite"> 3.
+      client script behaviour wrong in both<br>
+    </blockquote>
+    <br>
+    A modification of the UDP client solves this problem:<br>
+    <blockquote><tt># Client</tt><tt><br>
+      </tt><tt>BEGIN {</tt><tt><br>
+      </tt><tt>  print "moin" |&amp; "/inet/udp/0/localhost/8888"</tt><tt><br>
+      </tt><tt>  "/inet/udp/0/localhost/8888" |&amp; getline</tt><tt><br>
+      </tt><tt>  print $0</tt><tt><br>
+      </tt><tt>  close("/inet/udp/0/localhost/8888")</tt><tt><br>
+      </tt><tt>}</tt><tt><br>
+      </tt></blockquote>
+    <br>
+    The difference is in the very first print command.<br>
+    I am not really happy with this behaviour (because<br>
+    it is different from the equivalent TCP client) but it<br>
+    works.<br>
+    <br>
+  </body>
+</html>
+
+--------------030404060803030609050400--
+
+From address@hidden  Sun Mar 13 13:19:20 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id 0C6B4410
+       for <address@hidden>; Sun, 13 Mar 2016 13:19:20 -0400 (EDT)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id EDBDC6AB; Sun, 13 Mar 2016 13:19:19 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 9A42C4B
+       for <address@hidden>; Sun, 13 Mar 2016 13:19:19 -0400 (EDT)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 9A42C4B
+Authentication-Results: sv3.telemetry-investments.com; dmarc=none 
header.from=gnu.org
+Received: from localhost ([::1]:36889 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1af9fh-0001wk-6u
+       for address@hidden; Sun, 13 Mar 2016 13:19:17 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:37177)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1af9ff-0001wb-Ek
+       for address@hidden; Sun, 13 Mar 2016 13:19:16 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1af9fc-00045s-8L
+       for address@hidden; Sun, 13 Mar 2016 13:19:15 -0400
+Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41784)
+       by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <address@hidden>)
+       id 1af9fc-00045o-58; Sun, 13 Mar 2016 13:19:12 -0400
+Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4566
+       helo=home-c4e4a596f7)
+       by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
+       (Exim 4.82) (envelope-from <address@hidden>)
+       id 1af9fb-0007Zs-9E; Sun, 13 Mar 2016 13:19:11 -0400
+Date: Sun, 13 Mar 2016 19:18:42 +0200
+Message-Id: <address@hidden>
+From: Eli Zaretskii <address@hidden>
+To: =?windows-1252?Q?J=FCrgen_Kahrs?= <address@hidden>
+In-reply-to: <address@hidden> (address@hidden)
+References: <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden> <address@hidden>
+MIME-version: 1.0
+Content-type: text/plain; charset=windows-1252
+Content-Transfer-Encoding: 8bit
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
+X-Received-From: 2001:4830:134:3::e
+Cc: address@hidden
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+Reply-To: Eli Zaretskii <address@hidden>
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 640
+Lines: 27
+
+> From: "Jürgen Kahrs" <address@hidden>
+> Date: Sun, 13 Mar 2016 17:15:11 +0100
+> 
+>  3. client script behaviour wrong in both
+> 
+> 
+> A modification of the UDP client solves this problem:
+> 
+> 
+>  # Client
+>  BEGIN {
+>  print "moin" |& "/inet/udp/0/localhost/8888"
+>  "/inet/udp/0/localhost/8888" |& getline
+>  print $0
+>  close("/inet/udp/0/localhost/8888")
+>  }
+> 
+> 
+> The difference is in the very first print command.
+> I am not really happy with this behaviour (because
+> it is different from the equivalent TCP client) but it
+> works.
+
+Can you elaborate on why is it needed, or how does it solve the
+problem?
+
+Thanks.
+
+From address@hidden  Sun Mar 13 15:38:42 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id 929DD3D86
+       for <address@hidden>; Sun, 13 Mar 2016 15:38:42 -0400 (EDT)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id 835426B1; Sun, 13 Mar 2016 15:38:42 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id D97C66A3
+       for <address@hidden>; Sun, 13 Mar 2016 15:38:41 -0400 (EDT)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com D97C66A3
+Authentication-Results: sv3.telemetry-investments.com; dmarc=none 
header.from=skeeve.com
+Received: from localhost ([::1]:37371 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1afBqZ-0008V6-L7
+       for address@hidden; Sun, 13 Mar 2016 15:38:39 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:36471)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1afBqH-00088j-Av
+       for address@hidden; Sun, 13 Mar 2016 15:38:22 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1afBqE-0003E4-5I
+       for address@hidden; Sun, 13 Mar 2016 15:38:21 -0400
+Received: from mxout2.netvision.net.il ([194.90.9.21]:55648)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1afBqD-0003A4-Tn
+       for address@hidden; Sun, 13 Mar 2016 15:38:18 -0400
+MIME-version: 1.0
+Content-transfer-encoding: 7BIT
+Content-type: text/plain; CHARSET=US-ASCII
+Received: from skeeve.com ([93.173.16.221]) by mxout2.netvision.net.il
+       (Oracle Communications Messaging Server 7.0.5.30.0 64bit (built Oct 22
+       2013)) with ESMTPSA id <address@hidden> for
+       address@hidden; Sun, 13 Mar 2016 21:38:11 +0200 (IST)
+Received: from skeeve.com (skeeve.com [127.0.0.1])
+       by skeeve.com (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id
+       u2DJc9Ma009590; Sun, 13 Mar 2016 21:38:09 +0200
+Received: (from address@hidden)        by skeeve.com (8.14.4/8.14.4/Submit)
+       id u2DJc9jP009589;      Sun, 13 Mar 2016 21:38:09 +0200
+From: Aharon Robbins <address@hidden>
+Message-id: <address@hidden>
+Date: Sun, 13 Mar 2016 21:38:09 +0200
+To: address@hidden, address@hidden
+References: <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden> <address@hidden>
+In-reply-to: <address@hidden>
+User-Agent: Heirloom mailx 12.5 6/20/10
+X-detected-operating-system: by eggs.gnu.org: Solaris 10
+X-Received-From: 194.90.9.21
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 1063
+Lines: 50
+
+It's not working for me. I'm trying in the gawk-4.1.3 branch:
+
+$ git diff | cat
+diff --git a/io.c b/io.c
+index d700d87..cf45e45 100644
+--- a/io.c
++++ b/io.c
+@@ -1525,7 +1525,7 @@ socketopen(int family, int type, const char *localpname,
+ #ifdef MSG_PEEK
+                                       char buf[10];
+                                       struct sockaddr_storage remote_addr;
+-                                      socklen_t read_len = 0;
++                                      socklen_t read_len = sizeof remote_addr;
+ 
+                                       if (recvfrom(socket_fd, buf, 1, 
MSG_PEEK,
+                                               (struct sockaddr *) & 
remote_addr,
+
+
+
+$ cat Server 
+# Server
+BEGIN {
+  print strftime() |& "/inet/udp/8888/0/0"
+  close("/inet/udp/8888/0/0")
+}
+
+$ cat Client 
+# Client
+BEGIN {
+  print "howdy!" |& "/inet/udp/0/localhost/8888"
+  "/inet/udp/0/localhost/8888" |& getline
+  print $0
+  close("/inet/udp/0/localhost/8888")
+}
+
+Try to run it. Here, the client exited. Usually it just hangs:
+
+$ ./gawk -f Client & sleep 1 ; ./gawk -f Server &
+[1] 9581
+
+[1]+  Done                    ./gawk -f Client
+[1] 9583
+[aahz:pts/5 gawk.git]$ jobs
+[1]+  Running                 ./gawk -f Server &
+
+What am I missing?
+
+Thanks,
+
+Arnold
+
+From address@hidden  Sun Mar 13 16:23:45 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id 9A7683D86
+       for <address@hidden>; Sun, 13 Mar 2016 16:23:45 -0400 (EDT)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id 86C8C6CD; Sun, 13 Mar 2016 16:23:45 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 08BEE6B1
+       for <address@hidden>; Sun, 13 Mar 2016 16:23:43 -0400 (EDT)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 08BEE6B1
+Authentication-Results: sv3.telemetry-investments.com; dmarc=none 
header.from=gmail.com
+Authentication-Results: sv3.telemetry-investments.com;
+       dkim=fail reason="signature verification failed" (2048-bit key) 
header.d=gmail.com address@hidden header.b=sQwC+kbb
+Received: from localhost ([::1]:37550 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1afCYB-0003pN-Gg
+       for address@hidden; Sun, 13 Mar 2016 16:23:43 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:46433)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1afCY8-0003ou-NB
+       for address@hidden; Sun, 13 Mar 2016 16:23:41 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1afCY4-00064k-MB
+       for address@hidden; Sun, 13 Mar 2016 16:23:40 -0400
+Received: from mail-io0-x22f.google.com ([2607:f8b0:4001:c06::22f]:33430)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1afCY4-00064f-Gb
+       for address@hidden; Sun, 13 Mar 2016 16:23:36 -0400
+Received: by mail-io0-x22f.google.com with SMTP id n190so201550671iof.0
+       for <address@hidden>; Sun, 13 Mar 2016 13:23:36 -0700 (PDT)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
+       h=date:from:to:cc:subject:message-id:references:mime-version
+       :content-disposition:in-reply-to:user-agent;
+       bh=IVm0MbmzD6YuWF4+4GUlTWloF98v9mHM5epQyH/0sxo=;
+       b=sQwC+kbbncYWnCQR0RsRe/ghGXsbPjPnBuXdGzp+wjcbvHaDmNSwjyWJU9GRIn8yBb
+       UOqkJSgqDCxarlxL89WWBmsabcaumOpaDhtp3cYjr7baQi0kA8G19342sOmibhc/m9WM
+       CnQkdJv9xWX2ZWIbWvLOfJ1SI1AlujETIaq9rM7dnqmnzNtT7p2WXhxiCcZ+wsdo/YtG
+       SV6wJfKDDc0MBIhwoYpzmCcPsK1/D4roHzfOtVVop02/N54fPyyWZHGNcydtoinE8GjI
+       xzsbSNbVSJXP7u/GTHVJFW0SOdIxVezg/rSHKGh95Up8RdQBlXccP07QIwADRr243iSN
+       zPZg==
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=1e100.net; s=20130820;
+       h=x-gm-message-state:date:from:to:cc:subject:message-id:references
+       :mime-version:content-disposition:in-reply-to:user-agent;
+       bh=IVm0MbmzD6YuWF4+4GUlTWloF98v9mHM5epQyH/0sxo=;
+       b=k9QnlWC0lPUmVuQ+o9bfeF/Io7bjNHNZCEh1TpzxYNVHwR0Va+4gSlSKnpiHWM9xGn
+       4dIGOtMdyOGbSp2uzqLthrIQAr2Z6BP81rlTcn3Y+mp0tYzn49w/oMrwkBnJhTf4DJZL
+       1nN556Vnmqk7fKgFwzmBtdkXgvv938ZLsafCNgLWFvLpQFClIhhdwoR/03cpz6PrbIcU
+       QsXpV0a2QPzsb2lG2SmntByVnyp83qRZ6gziIVvgpEUbkykCWPWYV8jXM1NilzuBEWMh
+       gO6wYRG/6glaSPZVvfXum5JyXDm/ylEeCrBGeywUAMWRw8o+jMyoRTRgpc9ZBFQMJ+Aw
+       /AlA==
+X-Gm-Message-State: 
AD7BkJJx6ykjoDgw0dTBCbhNAtKT6dvXtfCowzXsVE9NxNMbGTvqT0lyYmBt+mvR8M4Pdg==
+X-Received: by 10.107.15.153 with SMTP id 25mr20157207iop.3.1457900615558;
+       Sun, 13 Mar 2016 13:23:35 -0700 (PDT)
+Received: from smok.internal (d23-17-121-177.abhsia.telus.net. [23.17.121.177])
+       by smtp.gmail.com with ESMTPSA id r73sm8107252ioe.5.2016.03.13.13.23.34
+       (version=TLS1_2 cipher=AES128-SHA bits=128/128);
+       Sun, 13 Mar 2016 13:23:35 -0700 (PDT)
+Date: Sun, 13 Mar 2016 14:23:32 -0600
+From: Michal Jaegermann <address@hidden>
+To: Aharon Robbins <address@hidden>
+Message-ID: <address@hidden>
+References: <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden> <address@hidden>
+       <address@hidden>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: inline
+In-Reply-To: <address@hidden>
+User-Agent: Mutt/1.5.23 (2014-03-12)
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
+X-Received-From: 2607:f8b0:4001:c06::22f
+Cc: address@hidden
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 1219
+Lines: 33
+
+On Sun, Mar 13, 2016 at 09:38:09PM +0200, Aharon Robbins wrote:
+> It's not working for me. I'm trying in the gawk-4.1.3 branch:
+
+I did that on the top of gawk-4.1-stable and it did work but
+not exactly like in the manual.  First I needed a server process,
+which was waiting, followed by a modified client.
+
+> $ cat Client 
+> # Client
+> BEGIN {
+>   print "howdy!" |& "/inet/udp/0/localhost/8888"
+>   "/inet/udp/0/localhost/8888" |& getline
+>   print $0
+>   close("/inet/udp/0/localhost/8888")
+> }
+
+It looks like that anything will do in the first print, including
+an empty string (which will send a line terminator anyway and I did
+not try without that one) but such client does exit right away without
+a server present.
+> 
+> What am I missing?
+
+OTOH this shows an expected message if a server is already there.
+
+I do not know at this moment what all of that means.  Looking at
+'man recvfrom' I see "If the caller is not interested in the source
+address, src_addr and addrlen  should  be specified as NULL".  
+This is clearly not the case in the current code.  In the other case
+the returned address is truncated to the declared (or provided?) size
+of a buffer so zero looks like something indeed too tight.
+
+    Michal
+
+From address@hidden  Sun Mar 13 16:00:17 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id 198993D86
+       for <address@hidden>; Sun, 13 Mar 2016 16:00:17 -0400 (EDT)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id 07C276B1; Sun, 13 Mar 2016 16:00:17 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id A5CC36A3
+       for <address@hidden>; Sun, 13 Mar 2016 16:00:16 -0400 (EDT)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com A5CC36A3
+Authentication-Results: sv3.telemetry-investments.com; dmarc=pass 
header.from=googlemail.com
+Authentication-Results: sv3.telemetry-investments.com;
+       dkim=pass (2048-bit key) header.d=googlemail.com address@hidden 
header.b=gD6ZilUE
+Received: from localhost ([::1]:37455 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1afCBS-0006yJ-Ho
+       for address@hidden; Sun, 13 Mar 2016 16:00:14 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:41640)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1afCBQ-0006yA-4r
+       for address@hidden; Sun, 13 Mar 2016 16:00:13 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1afCBL-0000D8-77
+       for address@hidden; Sun, 13 Mar 2016 16:00:12 -0400
+Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:36558)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1afCBL-0000Cq-0e
+       for address@hidden; Sun, 13 Mar 2016 16:00:07 -0400
+Received: by mail-wm0-x22a.google.com with SMTP id n186so81792090wmn.1
+       for <address@hidden>; Sun, 13 Mar 2016 13:00:06 -0700 (PDT)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=googlemail.com; s=20120113;
+       h=from:subject:to:references:message-id:date:user-agent:mime-version
+       :in-reply-to:content-transfer-encoding;
+       bh=q/+pC+x1gaEBbPJaVPNvg/0U4FaERXmg1fEqKDHz9BY=;
+       b=gD6ZilUEZeSRcMb47327Klv/c0Va0MB+yFKhU+vKD6iAmiobrEUq6t+QOJJpqPSJh8
+       D4c7LQbROeWMAvvcPenBt575mOMXfIB9AvMlnOHjH0kCcXFCvac6owWCnD/fXg9huf9l
+       KXb6c1Fdu+ipFMjDvkJyOZdt0FU7Fh4JkwOzdahhIvFZtDi2kmAm4NZCgScartaU7fjE
+       VT+Y6Ngunx9Zj3vqmGyEBY78B4fBCWhYGqKZtlENJeXJoLTpKG5T3r4jJ7yung2AEwUr
+       f5++lS3vRj6XlvnYIhdoSpzFKA/3jyO8pVjV0KtbRHZVxgswtC0IKiJgIxeff8AQbgEO
+       ErQQ==
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=1e100.net; s=20130820;
+       h=x-gm-message-state:from:subject:to:references:message-id:date
+       :user-agent:mime-version:in-reply-to:content-transfer-encoding;
+       bh=q/+pC+x1gaEBbPJaVPNvg/0U4FaERXmg1fEqKDHz9BY=;
+       b=a/ohc8YKeBaUVs0wTSBq08GqwTQAUPCdLRzmiIvETeDEyF6oJEpkqKYPM0Drlt7VMj
+       oKl9OrnLWo5EniGtRNBZz+/bPs+5OP24Flk8Y+TNKMidZbVuihPBpZ9UGra0DX5XxcDg
+       Ir3MA25qrRBepzKRqzZCh851shZfoTu+ebGE17Twn3W55eB+phNCZTb4u4APl9CjyANb
+       WUWEjyB9LreGYq5+2eaQNTboguLaOFZyVABS7QOkGn/fef3Yt4w7E3zrKbDIgoYNhduN
+       1wU4dRqT+GRB/jkKLk9H2OYAmGAknEyI1rqH4qpiGuaSc6iAczGfohMLUvRYIyDXKR6C
+       nkJw==
+X-Gm-Message-State: 
AD7BkJLw4YTOK8QE3C+0CJr81CqEDU9tloWX2TRddQmmVb2OvoKhb/mtvHNuvrl0kk1A5Q==
+X-Received: by 10.194.189.143 with SMTP id gi15mr20139665wjc.54.1457899206276; 
+       Sun, 13 Mar 2016 13:00:06 -0700 (PDT)
+Received: from [192.168.0.11] (ip5f5ac869.dynamic.kabel-deutschland.de.
+       [95.90.200.105]) by smtp.googlemail.com with ESMTPSA id
+       t8sm18981530wjy.41.2016.03.13.13.00.05
+       (version=TLSv1/SSLv3 cipher=OTHER);
+       Sun, 13 Mar 2016 13:00:05 -0700 (PDT)
+From: "=?UTF-8?Q?J=c3=bcrgen_Kahrs?=" <address@hidden>
+X-Google-Original-From: =?UTF-8?Q?J=c3=bcrgen_Kahrs?=
+       <address@hidden>
+To: Aharon Robbins <address@hidden>, address@hidden
+References: <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden> <address@hidden>
+       <address@hidden>
+Message-ID: <address@hidden>
+Date: Sun, 13 Mar 2016 21:00:04 +0100
+User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
+       Thunderbird/38.6.0
+MIME-Version: 1.0
+In-Reply-To: <address@hidden>
+Content-Type: text/plain; charset=windows-1252
+Content-Transfer-Encoding: 7bit
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
+X-Received-From: 2a00:1450:400c:c09::22a
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 123
+Lines: 5
+
+Am 13.03.2016 um 20:38 schrieb Aharon Robbins:
+> What am I missing?
+
+Start the server first, then the client, that's all.
+
+
+From address@hidden  Sun Mar 13 23:41:39 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id 575DE223
+       for <address@hidden>; Sun, 13 Mar 2016 23:41:39 -0400 (EDT)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id 449A56B1; Sun, 13 Mar 2016 23:41:39 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id AA19F598
+       for <address@hidden>; Sun, 13 Mar 2016 23:41:38 -0400 (EDT)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com AA19F598
+Authentication-Results: sv3.telemetry-investments.com; dmarc=none 
header.from=skeeve.com
+Received: from localhost ([::1]:38833 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1afJNw-0007Yr-7O
+       for address@hidden; Sun, 13 Mar 2016 23:41:36 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:36770)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1afJNt-0007Yc-Nb
+       for address@hidden; Sun, 13 Mar 2016 23:41:34 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1afJNq-0001DO-Ev
+       for address@hidden; Sun, 13 Mar 2016 23:41:33 -0400
+Received: from freefriends.org ([96.88.95.60]:50767)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1afJNq-0001DK-6h
+       for address@hidden; Sun, 13 Mar 2016 23:41:30 -0400
+X-Envelope-From: address@hidden
+Received: from freefriends.org (localhost [127.0.0.1])
+       by freefriends.org (8.14.9/8.14.9) with ESMTP id u2E3aRx9017399;
+       Sun, 13 Mar 2016 21:36:27 -0600
+Received: (from address@hidden)
+       by freefriends.org (8.14.9/8.14.9/submit) id u2E3aR24017398;
+       Mon, 14 Mar 2016 03:36:27 GMT
+From: address@hidden
+Message-Id: <address@hidden>
+X-Authentication-Warning: frenzy.freefriends.org: arnold set sender to
+       address@hidden using -f
+Date: Sun, 13 Mar 2016 21:36:27 -0600
+To: address@hidden, address@hidden, address@hidden
+References: <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+In-Reply-To: <address@hidden>
+User-Agent: Heirloom mailx 12.4 7/29/08
+MIME-Version: 1.0
+Content-Type: text/plain; charset=iso-8859-1
+Content-Transfer-Encoding: quoted-printable
+X-MIME-Autoconverted: from 8bit to quoted-printable by freefriends.org id
+       u2E3aRx9017399
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
+X-Received-From: 96.88.95.60
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 253
+Lines: 12
+
+"J=FCrgen Kahrs" <address@hidden> wrote:
+
+> Am 13.03.2016 um 20:38 schrieb Aharon Robbins:
+> > What am I missing?
+>
+> Start the server first, then the client, that's all.
+
+No difference. Both hang.
+
+Does it work for you in master?
+
+Arnold
+
+From address@hidden  Sun Mar 13 23:57:13 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id 501F0223
+       for <address@hidden>; Sun, 13 Mar 2016 23:57:13 -0400 (EDT)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id 3C2BE6B1; Sun, 13 Mar 2016 23:57:13 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 0E027598
+       for <address@hidden>; Sun, 13 Mar 2016 23:57:12 -0400 (EDT)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 0E027598
+Authentication-Results: sv3.telemetry-investments.com; dmarc=none 
header.from=skeeve.com
+Received: from localhost ([::1]:38862 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1afJd1-0000N9-0b
+       for address@hidden; Sun, 13 Mar 2016 23:57:11 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:39407)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1afJcy-0000Ma-Ch
+       for address@hidden; Sun, 13 Mar 2016 23:57:09 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1afJcv-0004di-4p
+       for address@hidden; Sun, 13 Mar 2016 23:57:08 -0400
+Received: from mxout2.netvision.net.il ([194.90.9.21]:48324)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1afJcu-0004dL-TM
+       for address@hidden; Sun, 13 Mar 2016 23:57:05 -0400
+MIME-version: 1.0
+Content-transfer-encoding: 7BIT
+Content-type: text/plain; CHARSET=US-ASCII
+Received: from skeeve.com ([93.173.16.221]) by mxout2.netvision.net.il
+       (Oracle Communications Messaging Server 7.0.5.30.0 64bit (built Oct 22
+       2013)) with ESMTPSA id <address@hidden> for
+       address@hidden; Mon, 14 Mar 2016 05:56:49 +0200 (IST)
+Received: from skeeve.com (skeeve.com [127.0.0.1])
+       by skeeve.com (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id
+       u2E3umlH009439; Mon, 14 Mar 2016 05:56:48 +0200
+Received: (from address@hidden)        by skeeve.com (8.14.4/8.14.4/Submit)
+       id u2E3umxW009438;      Mon, 14 Mar 2016 05:56:48 +0200
+From: Aharon Robbins <address@hidden>
+Message-id: <address@hidden>
+Date: Mon, 14 Mar 2016 05:56:48 +0200
+To: address@hidden, address@hidden, address@hidden
+References: <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+In-reply-to: <address@hidden>
+User-Agent: Heirloom mailx 12.5 6/20/10
+X-detected-operating-system: by eggs.gnu.org: Solaris 10
+X-Received-From: 194.90.9.21
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 1047
+Lines: 37
+
+> From address@hidden  Mon Mar 14 05:44:58 2016
+> Return-Path: <address@hidden>
+> X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
+>      frenzy.freefriends.org
+> X-Spam-Level: 
+> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,
+>      TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.1
+> X-Envelope-From: address@hidden
+> From: address@hidden
+> Date: Sun, 13 Mar 2016 21:36:27 -0600
+> To: address@hidden, address@hidden, address@hidden
+> Subject: Re: [gawk-devel] UDP networking doesn't work?
+> Content-Type: text/plain; charset=iso-8859-1
+> Status: R
+>
+> "J?rgen Kahrs" <address@hidden> wrote:
+>
+> > Am 13.03.2016 um 20:38 schrieb Aharon Robbins:
+> > > What am I missing?
+> >
+> > Start the server first, then the client, that's all.
+>
+> No difference. Both hang.
+>
+> Does it work for you in master?
+>
+> Arnold
+>
+
+I blew it. After making the change it works for me now.
+
+Juergen, can you send me an update to gawkinet.texi?  In the meantime
+I'll commit the fix.
+
+Thanks!
+
+Arnold
+
+From address@hidden  Mon Mar 14 13:32:30 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id 300482C9
+       for <address@hidden>; Mon, 14 Mar 2016 13:32:30 -0400 (EDT)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id 2065F6AC; Mon, 14 Mar 2016 13:32:30 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id C951D4E8
+       for <address@hidden>; Mon, 14 Mar 2016 13:32:29 -0400 (EDT)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com C951D4E8
+Authentication-Results: sv3.telemetry-investments.com; dmarc=none 
header.from=gmail.com
+Authentication-Results: sv3.telemetry-investments.com;
+       dkim=fail reason="signature verification failed" (2048-bit key) 
header.d=gmail.com address@hidden header.b=BZ5FE6tr
+Received: from localhost ([::1]:42733 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1afWLz-0000aC-Tj
+       for address@hidden; Mon, 14 Mar 2016 13:32:27 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:52262)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1afWLu-0000Zo-GR
+       for address@hidden; Mon, 14 Mar 2016 13:32:23 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1afWLq-00077e-Fo
+       for address@hidden; Mon, 14 Mar 2016 13:32:22 -0400
+Received: from mail-ig0-x236.google.com ([2607:f8b0:4001:c05::236]:38806)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1afWLq-00077I-AL
+       for address@hidden; Mon, 14 Mar 2016 13:32:18 -0400
+Received: by mail-ig0-x236.google.com with SMTP id ig19so67305486igb.1
+       for <address@hidden>; Mon, 14 Mar 2016 10:32:18 -0700 (PDT)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
+       h=date:from:to:cc:subject:message-id:references:mime-version
+       :content-disposition:in-reply-to:user-agent;
+       bh=pZ9e5h2J65b3fZ/nXyMZl9FBZ5QBM+JlqEfv8uZ3Cko=;
+       b=BZ5FE6trkz65XDpY+yPjKrJUa0NOaBDBVnatCU04SXwPmpOMoYRg4IlNPsESugY2fn
+       h1dlsqlZB6khAwrnGzfCX5ki4QG7gYiEv2KTkALdbDXSSwUpbrV48/UYQrw8ZjtR4GuC
+       tmpuoHlFnGYCurA9WwCiuNzRziFuz605L8gmNUgCIE6N8sqRIonggdqfsVxeyWRGdMNR
+       MjiTSlmrh+6oo+Ch9vQZXPBZdn1SSEVPYt8hsqtkmSObsfEjxKM6mmd/7KdYuvshKyTf
+       GpOZcFBpTLbi5SxBpIigHtBOW65hVBvK3zJC/QvsT0bGnXIhNnOgAPIimu9fNXY+dX4u
+       d//A==
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=1e100.net; s=20130820;
+       h=x-gm-message-state:date:from:to:cc:subject:message-id:references
+       :mime-version:content-disposition:in-reply-to:user-agent;
+       bh=pZ9e5h2J65b3fZ/nXyMZl9FBZ5QBM+JlqEfv8uZ3Cko=;
+       b=lgESyt+CwnWehin9Q5Pamrz78uO7HnudAPpu7RoV8cksSnroMeaA5rNmt0ZlCLdwFL
+       VHKCDbGACcHInDQSyPkd130SH7oYU5zotXHV0/QkkTETIQc9qzjZ962DCGtfl2TQr/rV
+       Gp3eqhu9LeAQFtahxBdr+cTuoc8prOh62IzCj/F539L+xIW7F6QRI1phyj+hJlFwnUa3
+       9J4Jw6Wzsf1fpZ4QYcs1sxrJub2CRiidcJPqj/YZOFjEsc54/qeO643wtgi+XGCoi+wD
+       w90s3HXEquPjsvXNPdsP+u11ZQ0Rg5lm9YqJxUCHYcEa87eo6YfJHI9EouZC01J5nCLm
+       cEFA==
+X-Gm-Message-State: 
AD7BkJLm+TRK+OuuipHbFJL68QW1im3335A4UIDV1t3gtT14xpzgYpvvHa0HQ3/hGU6e6g==
+X-Received: by 10.50.30.201 with SMTP id u9mr17793302igh.63.1457976737238;
+       Mon, 14 Mar 2016 10:32:17 -0700 (PDT)
+Received: from smok.internal (d23-17-121-177.abhsia.telus.net. [23.17.121.177])
+       by smtp.gmail.com with ESMTPSA id p8sm2685149igi.2.2016.03.14.10.32.16
+       (version=TLS1_2 cipher=AES128-SHA bits=128/128);
+       Mon, 14 Mar 2016 10:32:16 -0700 (PDT)
+Date: Mon, 14 Mar 2016 11:32:08 -0600
+From: Michal Jaegermann <address@hidden>
+To: Aharon Robbins <address@hidden>
+Message-ID: <address@hidden>
+References: <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: inline
+In-Reply-To: <address@hidden>
+User-Agent: Mutt/1.5.23 (2014-03-12)
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
+X-Received-From: 2607:f8b0:4001:c05::236
+Cc: address@hidden
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 453
+Lines: 15
+
+On Mon, Mar 14, 2016 at 05:56:48AM +0200, Aharon Robbins wrote:
+> 
+> Juergen, can you send me an update to gawkinet.texi?  In the meantime
+> I'll commit the fix.
+
+That change in io.c looks to me indeed correct but before going too far
+does anybody have a good explanation why this "magic incantation"
+
+> print "howdy!" |& "/inet/udp/0/localhost/8888"
+
+in a sample client is needed, what actually is doing, and why
+this is different for tcp?
+
+   Michal
+
+
+From address@hidden  Mon Mar 14 14:01:22 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id 7C18D410
+       for <address@hidden>; Mon, 14 Mar 2016 14:01:22 -0400 (EDT)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id 731376AC; Mon, 14 Mar 2016 14:01:22 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id D6F3F4E8
+       for <address@hidden>; Mon, 14 Mar 2016 14:01:21 -0400 (EDT)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com D6F3F4E8
+Authentication-Results: sv3.telemetry-investments.com; dmarc=pass 
header.from=googlemail.com
+Authentication-Results: sv3.telemetry-investments.com;
+       dkim=pass (2048-bit key) header.d=googlemail.com address@hidden 
header.b=ryVkKTx6
+Received: from localhost ([::1]:43128 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1afWnx-0006FG-B6
+       for address@hidden; Mon, 14 Mar 2016 14:01:21 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:57523)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1afWZk-0004GS-L1
+       for address@hidden; Mon, 14 Mar 2016 13:46:41 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1afWZh-0003C7-6d
+       for address@hidden; Mon, 14 Mar 2016 13:46:40 -0400
+Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]:37244)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1afWZg-0003Ac-R4
+       for address@hidden; Mon, 14 Mar 2016 13:46:37 -0400
+Received: by mail-wm0-x22f.google.com with SMTP id p65so113114501wmp.0
+       for <address@hidden>; Mon, 14 Mar 2016 10:46:36 -0700 (PDT)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=googlemail.com; s=20120113;
+       h=from:subject:to:references:cc:message-id:date:user-agent
+       :mime-version:in-reply-to;
+       bh=6n4ZCGJwx9tVj+7d31uvOD0WzNjI8AN9u1+PscAuF1w=;
+       b=ryVkKTx65M9cXRFDi4maEk8Ycla3HsArEAUGWOLx6lNm/gxmOp+ZehaXl7lksBa6G1
+       vg6Ks7YBx+EO0HzlWLLPADJK9kfqd0crSEs55koYzmcDMf9wq8G+PoZMdsxUzSUmqU1T
+       EnZZDngA1ToPOc2stzmmf+Rp+yMSsZCnfR2opalrMboGNrwVIoV1w/IIQoR9KAUT+Qxv
+       ACvJ6x/XycDqalxOGy0uFygy9hk/b45624TcVzPVifkeDZM/cyoHRlVlrGONtPzVRckN
+       HnQmhsJshdBO0O8SzPYpINEAN5cY5OCmzI2uwwMVVubhPQJE88bhJfPj5qgUHvh+j1tm
+       sQZA==
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=1e100.net; s=20130820;
+       h=x-gm-message-state:from:subject:to:references:cc:message-id:date
+       :user-agent:mime-version:in-reply-to;
+       bh=6n4ZCGJwx9tVj+7d31uvOD0WzNjI8AN9u1+PscAuF1w=;
+       b=PpjZ+nYDlgaQa2UM92f8gWPz4PQPZFnLeyqRNMGCZb/CM6Okq8Y52Vr/3hMgd1Zgp2
+       z7iNmgChQ13G0GqzpQkXX/blhCfBHaq3MOnGxGjzba7WRDQMlmvf11sA8Ep5Wt5+h/R7
+       zEHSVh9/rwjQaBCCNbTjYRFgQ/EHm9z3mGMiGd/Wd3zLFUNau8qtIilsgfrHrOmNVvpu
+       i3VIHIRePJ+yRRR2No02ydyUxUBbCjX9956V69hy7lG2X2a5iSt23q6sXmUbt0QNXNI/
+       sl8EFivYIw+m5vZgfNFwibrmNsYeqj4d4kz86ZXb+I8UA7+jf5n9kyRF+eF65hLDW3DF
+       1n3Q==
+X-Gm-Message-State: 
AD7BkJI35sgPvUuYzIsMivfSaxunrAPH/8ddjEhwaZlrUPdPkT5jMETRLfwxU0v3h0WAcA==
+X-Received: by 10.194.94.229 with SMTP id df5mr29417180wjb.133.1457977595816; 
+       Mon, 14 Mar 2016 10:46:35 -0700 (PDT)
+Received: from [192.168.0.11] (ip5f5ac8b9.dynamic.kabel-deutschland.de.
+       [95.90.200.185]) by smtp.googlemail.com with ESMTPSA id
+       u202sm17231836wmd.24.2016.03.14.10.46.34
+       (version=TLSv1/SSLv3 cipher=OTHER);
+       Mon, 14 Mar 2016 10:46:35 -0700 (PDT)
+From: "=?UTF-8?Q?J=c3=bcrgen_Kahrs?=" <address@hidden>
+X-Google-Original-From: =?UTF-8?Q?J=c3=bcrgen_Kahrs?=
+       <address@hidden>
+To: Michal Jaegermann <address@hidden>,
+       Aharon Robbins <address@hidden>
+References: <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+Message-ID: <address@hidden>
+Date: Mon, 14 Mar 2016 18:46:33 +0100
+User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
+       Thunderbird/38.6.0
+MIME-Version: 1.0
+In-Reply-To: <address@hidden>
+Content-Type: multipart/alternative;
+       boundary="------------070408080501020707080305"
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
+X-Received-From: 2a00:1450:400c:c09::22f
+Cc: address@hidden
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+X-Status: A
+Content-Length: 4644
+Lines: 129
+
+This is a multi-part message in MIME format.
+--------------070408080501020707080305
+Content-Type: text/plain; charset=windows-1252
+Content-Transfer-Encoding: 7bit
+
+Am 14.03.2016 um 18:32 schrieb Michal Jaegermann:
+> On Mon, Mar 14, 2016 at 05:56:48AM +0200, Aharon Robbins wrote:
+>> Juergen, can you send me an update to gawkinet.texi?  In the meantime
+>> I'll commit the fix.
+> That change in io.c looks to me indeed correct but before going too far
+> does anybody have a good explanation why this "magic incantation"
+>
+>> print "howdy!" |& "/inet/udp/0/localhost/8888"
+> in a sample client is needed, what actually is doing, and why
+> this is different for tcp?
+>
+>    Michal
+>
+
+Eli had already asked the same question.
+When I answered his question, I forgot to send a
+copy of my answer to the mailing list.
+This is what I sent to Eli:
+
+    In the case of UDP, the "print" commands is the one
+    that actually sends data so the there is a connection.
+    UDP and "connection" may sound strange to anyone
+    who has learned that UDP is a connection-less protocol.
+    Connection here means that the connect() system call
+    has completed its work and completed the "association"
+    between a certain socket and an IP address. There are
+    subtle differences between connect() for TCP and UDP.
+    See man page for details.
+
+    If you use the UDP client script as it is currently shown
+    in the doc, the client gets not quite connected to the
+    server (the server notices nothing, so sends nothing,
+    so the client receives nothing). This is of course an
+    ugly asymmetry between TCP and UDP as implemented
+    in GAWK. If someone suggests a more symmetric
+    solution, then it is probably worth changing the behaviour.
+    On the other hand we should be aware that this subtlety
+    is just one of many details that are hidden in the socket
+    API, invisible and intractable for the GAWK user.
+    We should not strive for making all details visible and
+    controllable for the GAWK user, this would be too much.
+
+
+
+
+
+--------------070408080501020707080305
+Content-Type: text/html; charset=windows-1252
+Content-Transfer-Encoding: 7bit
+
+<html>
+  <head>
+    <meta content="text/html; charset=windows-1252"
+      http-equiv="Content-Type">
+  </head>
+  <body bgcolor="#FFFFFF" text="#000000">
+    <div class="moz-cite-prefix">Am 14.03.2016 um 18:32 schrieb Michal
+      Jaegermann:<br>
+    </div>
+    <blockquote cite="mid:address@hidden"
+      type="cite">
+      <pre wrap="">On Mon, Mar 14, 2016 at 05:56:48AM +0200, Aharon Robbins 
wrote:
+</pre>
+      <blockquote type="cite">
+        <pre wrap="">
+Juergen, can you send me an update to gawkinet.texi?  In the meantime
+I'll commit the fix.
+</pre>
+      </blockquote>
+      <pre wrap="">
+That change in io.c looks to me indeed correct but before going too far
+does anybody have a good explanation why this "magic incantation"
+
+</pre>
+      <blockquote type="cite">
+        <pre wrap="">print "howdy!" |&amp; "/inet/udp/0/localhost/8888"
+</pre>
+      </blockquote>
+      <pre wrap="">
+in a sample client is needed, what actually is doing, and why
+this is different for tcp?
+
+   Michal
+
+</pre>
+    </blockquote>
+    <br>
+    Eli had already asked the same question.<br>
+    When I answered his question, I forgot to send a<br>
+    copy of my answer to the mailing list.<br>
+    This is what I sent to Eli:<br>
+    <blockquote>
+      <pre wrap="">In the case of UDP, the "print" commands is the one
+that actually sends data so the there is a connection.
+UDP and "connection" may sound strange to anyone
+who has learned that UDP is a connection-less protocol.
+Connection here means that the connect() system call
+has completed its work and completed the "association"
+between a certain socket and an IP address. There are
+subtle differences between connect() for TCP and UDP.
+See man page for details.
+
+If you use the UDP client script as it is currently shown
+in the doc, the client gets not quite connected to the
+server (the server notices nothing, so sends nothing,
+so the client receives nothing). This is of course an
+ugly asymmetry between TCP and UDP as implemented
+in GAWK. If someone suggests a more symmetric
+solution, then it is probably worth changing the behaviour.
+On the other hand we should be aware that this subtlety
+is just one of many details that are hidden in the socket
+API, invisible and intractable for the GAWK user.
+We should not strive for making all details visible and
+controllable for the GAWK user, this would be too much.
+
+
+</pre>
+    </blockquote>
+    <br>
+    <br>
+  </body>
+</html>
+
+--------------070408080501020707080305--
+
+From address@hidden  Mon Mar 14 14:18:04 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id 862E42C9
+       for <address@hidden>; Mon, 14 Mar 2016 14:18:04 -0400 (EDT)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id 7F5D86AC; Mon, 14 Mar 2016 14:18:04 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 516914E8
+       for <address@hidden>; Mon, 14 Mar 2016 14:18:03 -0400 (EDT)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 516914E8
+Authentication-Results: sv3.telemetry-investments.com; dmarc=none 
header.from=telemetry-investments.com
+Authentication-Results: sv3.telemetry-investments.com;
+       dkim=fail reason="key not found in DNS" (0-bit key) 
header.d=telemetry-investments.com address@hidden header.b=iNk59iBE
+Received: from localhost ([::1]:43243 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1afX47-0002SW-Hh
+       for address@hidden; Mon, 14 Mar 2016 14:18:03 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:40926)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1afX45-0002SP-2Q
+       for address@hidden; Mon, 14 Mar 2016 14:18:01 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1afX40-0004JM-2s
+       for address@hidden; Mon, 14 Mar 2016 14:18:01 -0400
+Received: from gw3a.telemetry-investments.com ([38.76.0.51]:57589
+       helo=sv3.telemetry-investments.com)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1afX3z-0004JI-VJ
+       for address@hidden; Mon, 14 Mar 2016 14:17:56 -0400
+Received: from ti129.telemetry-investments.com (ti129 [192.168.53.129])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 874434E8;
+       Mon, 14 Mar 2016 14:17:53 -0400 (EDT)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=telemetry-investments.com; s=tele1409; t=1457979474;
+       bh=2bX596H4mJG6UI1zSGfG2VUVMUILgtYiQwGSC5t8qJY=;
+       h=Date:From:To:Cc:Subject:References:In-Reply-To;
+       b=iNk59iBEoV/I7WpwrQ6PXHss8w1eYy5AFyaOgvQPDbycfkKtJqewipmEWhwg4ke7/
+       R4605/F2a9hnc2K72xfHXLBNyN6vcc7I6XxEEvKnqilS3xgwwjW+ntMzNV8G0uO3Qa
+       Cq9g3EOfsBiPSvKnhBD01+ciCEUIO32bRXhpZbIw=
+Received: by ti129.telemetry-investments.com (Postfix, from userid 300)
+       id 78232410; Mon, 14 Mar 2016 14:17:53 -0400 (EDT)
+Date: Mon, 14 Mar 2016 14:17:53 -0400
+From: "Andrew J. Schorr" <address@hidden>
+To: =?iso-8859-1?Q?J=FCrgen?= Kahrs <address@hidden>
+Message-ID: <address@hidden>
+References: <address@hidden>
+       <address@hidden>
+       <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: inline
+In-Reply-To: <address@hidden>
+User-Agent: Mutt/1.5.23 (2014-03-12)
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
+X-Received-From: 38.76.0.51
+Cc: address@hidden
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 932
+Lines: 25
+
+Hi,
+
+This is somewhat off-topic, but I continue to believe that the networking
+implementation in gawk doesn't really make sense, as discussed back in
+June/July 2013.  Now that we have non-blocking I/O (using
+PROCINFO["INPUT_NAME", "RETRY"]) and the select extension in gawkextlib, we can
+do this the right way.  The existing TCP solution accepts a single connection
+and then closes the listener socket in io.c:socketopen:
+
+       if (listen(socket_fd, 1) >= 0
+           && (clientsocket_fd = accept(socket_fd,
+               (struct sockaddr *) & remote_addr,
+               & namelen)) >= 0) {
+               closemaybesocket(socket_fd);
+               socket_fd = clientsocket_fd;
+               break;
+       }
+
+To me, these UDP problems are a reminder that the networking paradigm in 
+gawk is flawed. My guess is that nobody really uses anything other than
+the TCP client feature, so maybe we should scrap the UDP support and TCP
+server support and reimplement them to work in a sane fashion...
+
+Regards,
+Andy
+
+From address@hidden  Sun Mar 20 16:13:08 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id C1AA437B
+       for <address@hidden>; Sun, 20 Mar 2016 16:13:08 -0400 (EDT)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id B66AE6BC; Sun, 20 Mar 2016 16:13:08 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 4E4E9369
+       for <address@hidden>; Sun, 20 Mar 2016 16:13:07 -0400 (EDT)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 4E4E9369
+Authentication-Results: sv3.telemetry-investments.com; dmarc=pass 
header.from=googlemail.com
+Authentication-Results: sv3.telemetry-investments.com;
+       dkim=pass (2048-bit key) header.d=googlemail.com address@hidden 
header.b=H3BSRtto
+Received: from localhost ([::1]:54344 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1ahjii-0006Ns-2U
+       for address@hidden; Sun, 20 Mar 2016 16:13:04 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:57533)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1ahjic-0006Nh-NM
+       for address@hidden; Sun, 20 Mar 2016 16:12:59 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1ahjiX-0002X0-O1
+       for address@hidden; Sun, 20 Mar 2016 16:12:58 -0400
+Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:38600)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1ahjiX-0002W5-CU
+       for address@hidden; Sun, 20 Mar 2016 16:12:53 -0400
+Received: by mail-wm0-x229.google.com with SMTP id l68so99729118wml.1
+       for <address@hidden>; Sun, 20 Mar 2016 13:12:53 -0700 (PDT)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=googlemail.com; s=20120113;
+       h=from:subject:references:cc:message-id:date:user-agent:mime-version
+       :in-reply-to:content-transfer-encoding;
+       bh=o2tHEENYDte40oEYnSo4eBCjPoJBKKUbfQzeklnRRrw=;
+       b=H3BSRttocbo5B/5AouLLnFmsHYjI50La9NwL4y11CAi0rFxqEfEJopHs4tHZAa9ocD
+       6vJp8yc4czxPttAx9jR+M6xvZHDGmCFHexbU0798WH6xzNT6eJ9qZJGnAoLck17ewkqb
+       FPIAIApaM/sT8i1SeExVfoE3Cbr/BNuOVKAWl5oz+X6ue66Y36jGLcf9s2X8RnzVUCnw
+       ThfOP6Rq7W/hx5U9M6PJHLybmX77RSDKRNE7jsbAkUaiNV0tgn4I5Yh60T3U6xN9csco
+       1ZknNtH1v3i/wIEz0cfhpfPCSDN7vm8M6QJDnqJIreCwDAspMY0k9v7Lkh1t9dzbu9Az
+       qebQ==
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=1e100.net; s=20130820;
+       h=x-gm-message-state:from:subject:references:cc:message-id:date
+       :user-agent:mime-version:in-reply-to:content-transfer-encoding;
+       bh=o2tHEENYDte40oEYnSo4eBCjPoJBKKUbfQzeklnRRrw=;
+       b=fU58V5xtROq4M/n2P4O0o0IlTv9cmrcIbKupAF7e9bN7/IovzrFzcAaNCp440SnQ5O
+       eq92bVy2+DQ9n7uJdxgcdCt8v7hqLHp5sqfmjXPICJekNBwtmR1yvRNT6t2ZSjppKVau
+       X5WWu8YYwRKJ9D0vx3B2V4jVRaBf5kFjuEPnXA4QgkDZMr9ab49mtV1KMzdfqr3poFDs
+       ZH+WRlLl8j4BLYEmoIpYfQ4a2JH+hy+BQ3UWokiVoDVzKA9cuyhFEPYm0fgLvE9x35pf
+       PCYvKEUKwjxPavkHdl2IKyvXFREMt33TP1nFOt712PvsrawTd3KqlBwi4O9sCmSKPCqE
+       vzQQ==
+X-Gm-Message-State: 
AD7BkJKhiMGHrmiHcjQFrKW2uoHq4beN6opadGjxbPfEDCwkAJxE6bU6MFUoqh/J7SOb5w==
+X-Received: by 10.28.141.141 with SMTP id p135mr7543838wmd.8.1458504772383;
+       Sun, 20 Mar 2016 13:12:52 -0700 (PDT)
+Received: from [192.168.0.11] (ip5f5ac874.dynamic.kabel-deutschland.de.
+       [95.90.200.116]) by smtp.googlemail.com with ESMTPSA id
+       h67sm9166584wmf.15.2016.03.20.13.12.51 for <address@hidden>
+       (version=TLSv1/SSLv3 cipher=OTHER);
+       Sun, 20 Mar 2016 13:12:51 -0700 (PDT)
+From: "=?UTF-8?Q?J=c3=bcrgen_Kahrs?=" <address@hidden>
+X-Google-Original-From: =?UTF-8?Q?J=c3=bcrgen_Kahrs?=
+       <address@hidden>
+References: <address@hidden>
+       <address@hidden>
+       <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+Cc: address@hidden
+Message-ID: <address@hidden>
+Date: Sun, 20 Mar 2016 21:12:50 +0100
+User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
+       Thunderbird/38.6.0
+MIME-Version: 1.0
+In-Reply-To: <address@hidden>
+Content-Type: text/plain; charset=windows-1252
+Content-Transfer-Encoding: 7bit
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
+X-Received-From: 2a00:1450:400c:c09::229
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 2712
+Lines: 56
+
+Hello Andrew,
+
+> This is somewhat off-topic, but I continue to believe that the networking
+> implementation in gawk doesn't really make sense, as discussed back in
+> June/July 2013.  Now that we have non-blocking I/O (using
+> PROCINFO["INPUT_NAME", "RETRY"]) and the select extension in gawkextlib, we 
can
+> do this the right way.  The existing TCP solution accepts a single connection
+> and then closes the listener socket in io.c:socketopen:
+>
+>      if (listen(socket_fd, 1) >= 0
+>          && (clientsocket_fd = accept(socket_fd,
+>              (struct sockaddr *) & remote_addr,
+>              & namelen)) >= 0) {
+>              closemaybesocket(socket_fd);
+>              socket_fd = clientsocket_fd;
+>              break;
+>      }
+
+The current networking paradigm tries to treat every
+networking connection like a file. Trying to treat a connection
+like a file looked like a straightforward idea at that time, but it
+was in fact a bit difficult because there were so many differences
+between connections and files (for example port numbers, the
+difference between raw, datagram and stream data, and also
+socket options). Since then, the diversity in differences has
+increased ever more. It is obvious that all these details cannot
+be treated in detail and in portable manner.
+
+I understand your comment as a suggestion that the
+networking API should handle only a minimum of details
+and more advanced things should be handled with other
+mechanisms (that are either part of gawk or one of its
+extensions). I would agree, I see no other way that is
+realistic in the long term.
+
+> To me, these UDP problems are a reminder that the networking paradigm in 
+> gawk is flawed. My guess is that nobody really uses anything other than
+> the TCP client feature, so maybe we should scrap the UDP support and TCP
+> server support and reimplement them to work in a sane fashion...
+
+When I implemented the support for UDP, I thought it would
+be possible to offer the same networking API for TCP and UDP,
+for clients and for servers. As we have seen, even the example
+scripts that we tried cannot handle TCP and UDP in the same way.
+Even for TCP, the handling of differences between client and server
+connections is silently hidden in the parameters that are passed.
+This is ugly and not user-friendly of course.
+
+Your guess that no one really uses UDP may be true.
+Concerning the use of TCP server-scripts I can only guess.
+So your suggestion to remove the UDP support makes sense.
+This would allow for a real simplification in gawk's networking internals.
+Your suggestion to remove support for the TCP server side
+would simplify the implementation to a degree that the control
+flow in the source code could be called "straightforward".
+All in all, I would agree with your suggestions.
+
+From address@hidden  Sun Mar 20 23:55:17 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id 22EA937B
+       for <address@hidden>; Sun, 20 Mar 2016 23:55:17 -0400 (EDT)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id 1139B681; Sun, 20 Mar 2016 23:55:17 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 788F167D
+       for <address@hidden>; Sun, 20 Mar 2016 23:55:15 -0400 (EDT)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 788F167D
+Authentication-Results: sv3.telemetry-investments.com; dmarc=none 
header.from=skeeve.com
+Received: from localhost ([::1]:55446 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1ahqvx-0000mz-HC
+       for address@hidden; Sun, 20 Mar 2016 23:55:13 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:49069)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1ahqvv-0000mt-Nr
+       for address@hidden; Sun, 20 Mar 2016 23:55:12 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1ahqvq-0007U7-NU
+       for address@hidden; Sun, 20 Mar 2016 23:55:11 -0400
+Received: from mxout2.netvision.net.il ([194.90.9.21]:57721)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1ahqvq-0007TF-FH
+       for address@hidden; Sun, 20 Mar 2016 23:55:06 -0400
+MIME-version: 1.0
+Content-transfer-encoding: 7BIT
+Content-type: text/plain; CHARSET=US-ASCII
+Received: from skeeve.com ([93.173.16.221]) by mxout2.netvision.net.il
+       (Oracle Communications Messaging Server 7.0.5.30.0 64bit (built Oct 22
+       2013)) with ESMTPSA id <address@hidden> for
+       address@hidden; Mon, 21 Mar 2016 05:55:00 +0200 (IST)
+Received: from skeeve.com (skeeve.com [127.0.0.1])
+       by skeeve.com (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id
+       u2L3sxaK016470; Mon, 21 Mar 2016 05:54:59 +0200
+Received: (from address@hidden)        by skeeve.com (8.14.4/8.14.4/Submit)
+       id u2L3swdW016469;      Mon, 21 Mar 2016 05:54:58 +0200
+From: Aharon Robbins <address@hidden>
+Message-id: <address@hidden>
+Date: Mon, 21 Mar 2016 05:54:58 +0200
+To: address@hidden
+References: <address@hidden>
+       <address@hidden>
+       <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+In-reply-to: <address@hidden>
+User-Agent: Heirloom mailx 12.5 6/20/10
+X-detected-operating-system: by eggs.gnu.org: Solaris 10
+X-Received-From: 194.90.9.21
+Cc: address@hidden
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 963
+Lines: 28
+
+Hi.
+
+I don't have a problem with marking UDP as obsolete.
+
+I would prefer to continue to be able to have both server and client
+on the TCP side.
+
+I would strongly prefer to do this in a way that doesn't break old
+programs using TCP.
+
+One thing that bothers me right now is that getaddrinfo() returns
+a linked list of struct addrinfo, and the gawk paradigm assumes that
+/inet/... will only map to one possible connection, an (IPv?, address, port)
+triple.  This should be dealt with reasonably in the case that more
+than one struct addrinfo comes back. (Probably a fatal error.)
+
+Andy and Juergen, feel free to work on a design and set up a separate
+branch off of master to work on this.
+
+In the meantime, I have updated the doc based on one of Juergen's emails
+and pushed the changes to the repo.
+
+(As a side note, how did the original UDP client ever work? I have a vague
+memory of having tested it and that it did work... That also bothers me.)
+
+Thanks,
+
+Arnold
+
+From address@hidden  Sun Mar 27 15:24:09 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id 7DB0422A
+       for <address@hidden>; Sun, 27 Mar 2016 15:24:09 -0400 (EDT)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id 727926A9; Sun, 27 Mar 2016 15:24:09 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 29F5D36A
+       for <address@hidden>; Sun, 27 Mar 2016 15:24:08 -0400 (EDT)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 29F5D36A
+Authentication-Results: sv3.telemetry-investments.com; dmarc=pass 
header.from=googlemail.com
+Authentication-Results: sv3.telemetry-investments.com;
+       dkim=pass (2048-bit key) header.d=googlemail.com address@hidden 
header.b=Lix8Cacv
+Received: from localhost ([::1]:37179 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1akGIA-0007bd-0d
+       for address@hidden; Sun, 27 Mar 2016 15:24:06 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:43872)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1akGI7-0007bY-Di
+       for address@hidden; Sun, 27 Mar 2016 15:24:04 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1akGI4-00037V-7Z
+       for address@hidden; Sun, 27 Mar 2016 15:24:03 -0400
+Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:36508)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1akGI3-00037O-W5
+       for address@hidden; Sun, 27 Mar 2016 15:24:00 -0400
+Received: by mail-wm0-x242.google.com with SMTP id l68so16394571wml.3
+       for <address@hidden>; Sun, 27 Mar 2016 12:23:59 -0700 (PDT)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=googlemail.com; s=20120113;
+       h=from:subject:to:references:cc:message-id:date:user-agent
+       :mime-version:in-reply-to:content-transfer-encoding;
+       bh=XWsAXxBAmHCZbTTAxl0zQUZjQ0yb4isOCqIUw2KU1Fk=;
+       b=Lix8CacvxJnUFk/mLgyhAmx04VDGwZLDL6KVXRsKDYSlyNlJ7FPk4dFagDGAg8aurZ
+       7zyVjY5vxXSgtKUw7m2oawF5uBkYuyXl5xvgD6Ogq59FjaAGr94Gkbt/9CWjG27OCZgg
+       K7dHW+uIdCgzkgsLLzZj3+qyA66/2/VHBKhkyG2TnWEXuIxcRrO40N5tG1UBz7J739gP
+       3AY8lrF3+Vh/UMh0vC2ywC39rzIEIOX3vATK5pYHzSv7GAZLaq2/NrL+TSaj/ziIdum5
+       I3uRScvEBZQh2YJq7p7WjOgHvAMrV7mkxdnync1I9F6mseCTWz4PtHlWfWOCTVcerVz/
+       IFMw==
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=1e100.net; s=20130820;
+       h=x-gm-message-state:from:subject:to:references:cc:message-id:date
+       :user-agent:mime-version:in-reply-to:content-transfer-encoding;
+       bh=XWsAXxBAmHCZbTTAxl0zQUZjQ0yb4isOCqIUw2KU1Fk=;
+       b=Y84qRzpqkCsIvjdScyYnEriHyB6QGSSwi5CC4aBSOj6N9/HO1j4lyy1TAOyH12MnSp
+       l1TKTKUKUB/z4Bu5BPYx4mleRARwEuc0iB04ZR5EiK/4Xv9Jufqkbqj9ml86nLHixOvp
+       xiX1wLDi6BktB7eFjRVelz7PnioE28mH++guqiSD75hMCX/g0vkMps/am/8uo1ScyEVj
+       zLWmiz7iD2sDNrDpMewyzaQFBpziHYoVTXN8aKC369yeiHuYasvJ7SYjlQgTmaRR2CzL
+       TOlYN+LXFCIagBnAaY7v2WXgMtBtnWnjcysCQnXiDSUx8jEio87sP3PextEKr0B64KFZ
+       Me6A==
+X-Gm-Message-State: 
AD7BkJKddXjGqptDZXG7wsWMvvamfHr9gkdo/MN2YORd6Z685+CMvBn/c39XPB/LVQFzXg==
+X-Received: by 10.28.34.67 with SMTP id i64mr6925949wmi.85.1459106638757;
+       Sun, 27 Mar 2016 12:23:58 -0700 (PDT)
+Received: from [192.168.0.11] (ip5f5ac842.dynamic.kabel-deutschland.de.
+       [95.90.200.66]) by smtp.googlemail.com with ESMTPSA id
+       s66sm7006743wmb.6.2016.03.27.12.23.57
+       (version=TLSv1/SSLv3 cipher=OTHER);
+       Sun, 27 Mar 2016 12:23:58 -0700 (PDT)
+From: "=?UTF-8?Q?J=c3=bcrgen_Kahrs?=" <address@hidden>
+X-Google-Original-From: =?UTF-8?Q?J=c3=bcrgen_Kahrs?=
+       <address@hidden>
+To: Aharon Robbins <address@hidden>
+References: <address@hidden>
+       <address@hidden>
+       <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+Message-ID: <address@hidden>
+Date: Sun, 27 Mar 2016 21:23:56 +0200
+User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
+       Thunderbird/38.7.0
+MIME-Version: 1.0
+In-Reply-To: <address@hidden>
+Content-Type: text/plain; charset=windows-1252
+Content-Transfer-Encoding: 7bit
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
+X-Received-From: 2a00:1450:400c:c09::242
+Cc: address@hidden
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 2102
+Lines: 50
+
+Am 21.03.2016 um 04:54 schrieb Aharon Robbins:
+> I don't have a problem with marking UDP as obsolete.
+
+So we agree in this point. For the moment it may a good
+idea to simply mention obsolescence of UDP in the doc.
+
+> I would prefer to continue to be able to have both server and client
+> on the TCP side.
+
+Agreed, there are really interesting applications built upon
+both of them.
+
+> I would strongly prefer to do this in a way that doesn't break old
+> programs using TCP.
+
+Agreed, of course.
+
+> One thing that bothers me right now is that getaddrinfo() returns
+> a linked list of struct addrinfo, and the gawk paradigm assumes that
+> /inet/... will only map to one possible connection, an (IPv?, address, port)
+> triple.  This should be dealt with reasonably in the case that more
+> than one struct addrinfo comes back. (Probably a fatal error.)
+
+That's right. But there are several ways of dealing with a list that
+contains more the one entry. Some doc that I read suggests opening
+connections for all of the available entries. Another possibility would be
+to use the name (/inet or /inet4) as a hint that can be passed to the
+getaddrinfo() system call. Instead of raising a fatal error (in case of
+more than 1 entry) it could make sense to simply use the very first
+entry.
+
+> Andy and Juergen, feel free to work on a design and set up a separate
+> branch off of master to work on this.
+
+The working habbits of git are currently beyond my horizon
+since I used SVN on a daily basis in several projects.
+But working with patches in the usual "diff -u" format would be Ok.
+
+> In the meantime, I have updated the doc based on one of Juergen's emails
+> and pushed the changes to the repo.
+
+Hmm, yes, inserting them as you did is probably a good idea.
+Thanks for doing this.
+
+> (As a side note, how did the original UDP client ever work? I have a vague
+> memory of having tested it and that it did work... That also bothers me.)
+
+I have thought about it for a while but have not come to
+a convincing conclusion. Perhaps you tested only one
+side (client or server) and simulated the other side with netcat.
+
+From address@hidden  Sun Mar 27 17:10:16 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id BE2C63E14
+       for <address@hidden>; Sun, 27 Mar 2016 17:10:16 -0400 (EDT)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id AC7F96A9; Sun, 27 Mar 2016 17:10:16 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 70682697
+       for <address@hidden>; Sun, 27 Mar 2016 17:10:15 -0400 (EDT)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 70682697
+Authentication-Results: sv3.telemetry-investments.com; dmarc=none 
header.from=gmail.com
+Authentication-Results: sv3.telemetry-investments.com;
+       dkim=fail reason="signature verification failed" (2048-bit key) 
header.d=gmail.com address@hidden header.b=PfdWxm7H
+Received: from localhost ([::1]:37428 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1akHwr-0006a6-MG
+       for address@hidden; Sun, 27 Mar 2016 17:10:13 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:33103)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1akHwp-0006a1-FV
+       for address@hidden; Sun, 27 Mar 2016 17:10:12 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1akHwl-0007U5-Fo
+       for address@hidden; Sun, 27 Mar 2016 17:10:11 -0400
+Received: from mail-io0-x22b.google.com ([2607:f8b0:4001:c06::22b]:35159)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1akHwl-0007Tu-B0
+       for address@hidden; Sun, 27 Mar 2016 17:10:07 -0400
+Received: by mail-io0-x22b.google.com with SMTP id g185so3491774ioa.2
+       for <address@hidden>; Sun, 27 Mar 2016 14:10:07 -0700 (PDT)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
+       h=date:from:to:cc:subject:message-id:references:mime-version
+       :content-disposition:content-transfer-encoding:in-reply-to
+       :user-agent; bh=/iODLLb8/6qOAaljk1snPcw+fhGS6eY0j0JKabydXnE=;
+       b=PfdWxm7H7MWuJzGQnxDVlYP9U6i5MagiOQLhRcHd4nUVddELERzAz76cFp5jo9YckI
+       iiFvsJv5BCQcKSZjZHNjJWF4SB8DqUE9yEXA0MyJu/E1fNloNSwZY4W+bj4YC332PLEu
+       42i+tbFPngPyuQLTOI9a8LI3tRR3m31G+qNmaekAd54f9iGgj3rw30xTXPy/tpyN7X6A
+       HHpbBUn1dkNO85gUfE1o3IMdsRTRE3MgMRrKKfD6cjTmmhvMVPs7lZnvhN2RQ73Trrlq
+       OUas40EhsAom6WR8XKsL4eurVg8m2sm4pbIhGTwdgwr8XAlop3TyH5+oVSCLEXW++Mpm
+       1Y0Q==
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=1e100.net; s=20130820;
+       h=x-gm-message-state:date:from:to:cc:subject:message-id:references
+       :mime-version:content-disposition:content-transfer-encoding
+       :in-reply-to:user-agent;
+       bh=/iODLLb8/6qOAaljk1snPcw+fhGS6eY0j0JKabydXnE=;
+       b=K1fhyxbu7/GZcChuzK+AsBUeYYJquPil2g9hZ/qc9r6Ci6i7UnSwvuoKVoAS89A973
+       A+miFySMpytC0pQCloa+/lUQJT+YZZ1+hEiveKOgtfjV9V2PV7wc6AcajRe12je65BTU
+       14btGqHrJNtuxMMadngBEXHTg9GkxeXWAqZjFbR8qiL5OjqGBEfP0K7tyK/pHqvcOAvV
+       FT8JIFQa6c+oCcVom/8EXBiAptEz4/uBcFiMCYLUdmB1yzN8qxih8VdYTaFaVwOZWIyS
+       m1wUeB5KZN35kfg13e03Guc2xz3QZ/8uzIb+CIPsi+hah/WR9IyaVtfTux8aWIf0CY7d
+       S+/A==
+X-Gm-Message-State: 
AD7BkJIUh3/p/MgF+QUZoouI0sfy6Fq0WNSfocDMArcWsoFHlWBUdQLqdY019CE2x4ykoQ==
+X-Received: by 10.107.10.214 with SMTP id 83mr21688645iok.64.1459113006701;
+       Sun, 27 Mar 2016 14:10:06 -0700 (PDT)
+Received: from smok.internal (d23-17-121-177.abhsia.telus.net. [23.17.121.177])
+       by smtp.gmail.com with ESMTPSA id d7sm2824495igg.18.2016.03.27.14.10.05
+       (version=TLS1_2 cipher=AES128-SHA bits=128/128);
+       Sun, 27 Mar 2016 14:10:06 -0700 (PDT)
+Date: Sun, 27 Mar 2016 15:10:03 -0600
+From: Michal Jaegermann <address@hidden>
+To: =?iso-8859-1?Q?J=FCrgen?= Kahrs <address@hidden>
+Message-ID: <address@hidden>
+References: <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=iso-8859-1
+Content-Disposition: inline
+Content-Transfer-Encoding: 8bit
+In-Reply-To: <address@hidden>
+User-Agent: Mutt/1.5.23 (2014-03-12)
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
+X-Received-From: 2607:f8b0:4001:c06::22b
+Cc: address@hidden
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 1110
+Lines: 24
+
+On Sun, Mar 27, 2016 at 09:23:56PM +0200, Jürgen Kahrs wrote:
+> Am 21.03.2016 um 04:54 schrieb Aharon Robbins:
+> 
+> > One thing that bothers me right now is that getaddrinfo() returns
+> > a linked list of struct addrinfo, and the gawk paradigm assumes that
+> > /inet/... will only map to one possible connection,
+
+I do not see a contradiction here.  It is quite possible for one
+connection to have multiple addresses.
+....
+> Instead of raising a fatal error (in case of
+> more than 1 entry) it could make sense to simply use the very first
+> entry.
+
+I do not think that this will work in general.  Even discounting
+multi-homed interfaces you should consider as a quite normal a situation
+when you have on an interface an IPv4 address and IPv6 one.  If the
+first entry happens to be on a network where you can get a connection
+with the other machine then you are ok; otherwise you will get "not
+reachable".  I do not see how one can avoid walking through that
+linked list from getaddrinfo() while trying entries one by one and
+returning an error only after all possibilities failed.  What do I miss?
+
+   Michal
+
+From address@hidden  Mon Mar 28 08:30:46 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id B96F18A
+       for <address@hidden>; Mon, 28 Mar 2016 08:30:46 -0400 (EDT)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id B126F69B; Mon, 28 Mar 2016 08:30:46 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 46F1C44C
+       for <address@hidden>; Mon, 28 Mar 2016 08:30:46 -0400 (EDT)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 46F1C44C
+Authentication-Results: sv3.telemetry-investments.com; dmarc=none 
header.from=skeeve.com
+Received: from localhost ([::1]:40789 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1akWJg-0005nx-Lr
+       for address@hidden; Mon, 28 Mar 2016 08:30:44 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:38114)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1akWJY-0005mR-HK
+       for address@hidden; Mon, 28 Mar 2016 08:30:42 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1akWJV-0002vO-88
+       for address@hidden; Mon, 28 Mar 2016 08:30:36 -0400
+Received: from freefriends.org ([96.88.95.60]:52668)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1akWJV-0002uN-09
+       for address@hidden; Mon, 28 Mar 2016 08:30:33 -0400
+X-Envelope-From: address@hidden
+Received: from freefriends.org (localhost [127.0.0.1])
+       by freefriends.org (8.14.9/8.14.9) with ESMTP id u2SCPP8t000831;
+       Mon, 28 Mar 2016 06:25:25 -0600
+Received: (from address@hidden)
+       by freefriends.org (8.14.9/8.14.9/submit) id u2SCPOeP000830;
+       Mon, 28 Mar 2016 12:25:24 GMT
+From: address@hidden
+Message-Id: <address@hidden>
+X-Authentication-Warning: frenzy.freefriends.org: arnold set sender to
+       address@hidden using -f
+Date: Mon, 28 Mar 2016 06:25:24 -0600
+To: address@hidden, address@hidden
+References: <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden> <address@hidden>
+In-Reply-To: <address@hidden>
+User-Agent: Heirloom mailx 12.4 7/29/08
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+Content-Transfer-Encoding: 7bit
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
+X-Received-From: 96.88.95.60
+Cc: address@hidden
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 324
+Lines: 11
+
+My main concern is what if more than one of the results from getaddrinfo
+would work?  It makes no sense to associate multiple sockets with one
+redirection.
+
+I guess the thing to do is loop through the results and use the
+first one that works, then skip the rest.  That's probably better than
+a fatal error.
+
+Thanks,
+
+Arnold
+
+From address@hidden  Sun Apr  3 14:59:32 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id BE22C1D1
+       for <address@hidden>; Sun,  3 Apr 2016 14:59:32 -0400 (EDT)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id B55B96CC; Sun,  3 Apr 2016 14:59:32 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 6EE1C279
+       for <address@hidden>; Sun,  3 Apr 2016 14:59:32 -0400 (EDT)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 6EE1C279
+Authentication-Results: sv3.telemetry-investments.com; dmarc=pass 
header.from=googlemail.com
+Authentication-Results: sv3.telemetry-investments.com;
+       dkim=pass (2048-bit key) header.d=googlemail.com address@hidden 
header.b=HOHRmMhj
+Received: from localhost ([::1]:54843 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1amnFC-0007bE-LH
+       for address@hidden; Sun, 03 Apr 2016 14:59:30 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:50245)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1amnFA-0007at-A5
+       for address@hidden; Sun, 03 Apr 2016 14:59:29 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1amnF5-0000Q0-GC
+       for address@hidden; Sun, 03 Apr 2016 14:59:28 -0400
+Received: from mail-lf0-x235.google.com ([2a00:1450:4010:c07::235]:34949)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1amnF5-0000Pw-2p
+       for address@hidden; Sun, 03 Apr 2016 14:59:23 -0400
+Received: by mail-lf0-x235.google.com with SMTP id c126so21006742lfb.2
+       for <address@hidden>; Sun, 03 Apr 2016 11:59:22 -0700 (PDT)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=googlemail.com; s=20120113;
+       h=from:subject:references:cc:message-id:date:user-agent:mime-version
+       :in-reply-to; bh=jymzw5+fgpC7Xi4deyYmr+qUyY4nyb1mppAeUXF+Aw8=;
+       b=HOHRmMhjrxLnUVE/+OtfeKBypyvsrPyrPBIOMd5fuVbo1+vzN447Uts+WK4zqKfuhV
+       j3ewEjTu9HJGYmUSo35gMIJy2EYKUxfR7PhDv7OO4gP05SEDx49VOa9WF7XGOSr5G41+
+       Z1BopLZ0Xc4OfegQUryhhCIYztk9snznJLtcgiq+lU7b6jEYOgCvxcRS5f9PEph/2lJR
+       Kq2bLJckNPRxpOR/zJ27xCjvfKkYXWw3vRrwKRWSvMDRQjz3EVbdXErcapdQ6g1AkoCN
+       3BsW/FLwfK2+h95TqUTriz03s47qa3LQwGOT1Wl8XJSe9UhT86XAZoSf89vY99r6VZEJ
+       kcLw==
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=1e100.net; s=20130820;
+       h=x-gm-message-state:from:subject:references:cc:message-id:date
+       :user-agent:mime-version:in-reply-to;
+       bh=jymzw5+fgpC7Xi4deyYmr+qUyY4nyb1mppAeUXF+Aw8=;
+       b=B2heQJ93aQ3zzmxM4de5kJzCk3WjR8wRsMPfI+Rz0BUEXUfDDQCGgS/r8+jmHowawa
+       h07XBnPnDYJv5St10F9OV/Ppa0Byr27jgN7t4u6AOEk9bKM98SdS7eyVLyD4gfvlpAT8
+       kQdHsoBR5nxgesiy4FX6tiCZTuI4OkF+W7kSJv7UkWFA4k0ZqnzGrTULwdhdeZs5O3yK
+       97yKj/5PyfAOW4pBe5Anw4XQCi5jpyZMnIaCQ3kaTujWQoWbXYe+tH1szpISoOBqng9J
+       lEYO1yz33v5LbEQ5z8ZTGdUbyfAlcjacfqBO7+pWafkZijVblUV+v1qqNBiUjD3G2Pn6
+       QvSQ==
+X-Gm-Message-State: 
AD7BkJLInubFPFh4UaSgzB21De6DYkVSjc9/2ljFUf0Crz9vBSuVEejYjSnS7eB50vkCfg==
+X-Received: by 10.194.192.106 with SMTP id hf10mr724423wjc.134.1459709961797; 
+       Sun, 03 Apr 2016 11:59:21 -0700 (PDT)
+Received: from [192.168.0.11] (ip5f5ac887.dynamic.kabel-deutschland.de.
+       [95.90.200.135]) by smtp.googlemail.com with ESMTPSA id
+       m6sm25094147wje.21.2016.04.03.11.59.20 for <address@hidden>
+       (version=TLSv1/SSLv3 cipher=OTHER);
+       Sun, 03 Apr 2016 11:59:21 -0700 (PDT)
+From: "=?UTF-8?Q?J=c3=bcrgen_Kahrs?=" <address@hidden>
+X-Google-Original-From: =?UTF-8?Q?J=c3=bcrgen_Kahrs?=
+       <address@hidden>
+References: <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden> <address@hidden>
+       <address@hidden>
+Cc: address@hidden
+Message-ID: <address@hidden>
+Date: Sun, 3 Apr 2016 20:59:19 +0200
+User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
+       Thunderbird/38.7.0
+MIME-Version: 1.0
+In-Reply-To: <address@hidden>
+Content-Type: multipart/alternative;
+       boundary="------------010504090001020009000105"
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
+X-Received-From: 2a00:1450:4010:c07::235
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 6276
+Lines: 142
+
+This is a multi-part message in MIME format.
+--------------010504090001020009000105
+Content-Type: text/plain; charset=windows-1252
+Content-Transfer-Encoding: 7bit
+
+Am 28.03.2016 um 14:25 schrieb address@hidden:
+> My main concern is what if more than one of the results from getaddrinfo
+> would work?  It makes no sense to associate multiple sockets with one
+> redirection.
+>
+> I guess the thing to do is loop through the results and use the
+> first one that works, then skip the rest.  That's probably better than
+> a fatal error.
+
+I had a look at io.c socketopen.
+It seems to do exactly what you suggested.
+It even honours the "type" and the "family" of the
+networking interface (IPV4/6 and TCP/UDP) that
+can be deduced form the /inet path.
+There are two nested "while" loops, the outer loop for the
+local port and the inner loop for the remote port.
+These nested loops try to open a connection for every
+combination of local and remote port (taking into account
+the hints/restrictions from /inet). Upon first successful
+connection, both loops are left with the socket left open.
+The loops go on looping as long as the connection
+build-up is unsuccessful (or no combinations left to try).
+
+The source code is a bit difficult to read because of
+the "gotos", the nested "breaks" and the "returns".
+But it looks clean and makes sense. Even the cleanup
+with the freeaddrinfo() system call seems Ok.
+Really not bad.
+
+
+> One thing that bothers me right now is that getaddrinfo() returns
+> a linked list of struct addrinfo, and the gawk paradigm assumes that
+> /inet/... will only map to one possible connection, an (IPv?, address, port)
+> triple.  This should be dealt with reasonably in the case that more
+> than one struct addrinfo comes back. (Probably a fatal error.)
+
+As mentioned above, the current behaviour looks fine to me.
+But let me mention one side-effect that might confuse you
+if you use "strace" to look at what the interpreter actually does.
+When using the client and server example code, you will see
+several socket() systems calls as the nested loops do their
+work of trying all combinations. There is even one for SOCK_RAW.
+
+    strace ./gawk -f client.awk 2>&1 | grep socket
+
+    socket(PF_NETLINK, SOCK_RAW, 0)         = 3
+    socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
+    socket(PF_NETLINK, SOCK_RAW, 0)         = 3
+    socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 3
+
+This is ugly, probably annoying, but not fatal.
+What remains to be done is to remove the support for
+UDP in io.c as well as in the doc and to improve the conceptual
+description of TCP in the doc. Do we agree ?
+
+
+
+--------------010504090001020009000105
+Content-Type: text/html; charset=windows-1252
+Content-Transfer-Encoding: 8bit
+
+<html>
+  <head>
+    <meta content="text/html; charset=windows-1252"
+      http-equiv="Content-Type">
+  </head>
+  <body bgcolor="#FFFFFF" text="#000000">
+    <div class="moz-cite-prefix">Am 28.03.2016 um 14:25 schrieb
+      <a class="moz-txt-link-abbreviated" 
href="mailto:address@hidden";>address@hidden</a>:<br>
+    </div>
+    <blockquote cite="mid:address@hidden"
+      type="cite">
+      <pre wrap="">My main concern is what if more than one of the results 
from getaddrinfo
+would work?  It makes no sense to associate multiple sockets with one
+redirection.
+
+I guess the thing to do is loop through the results and use the
+first one that works, then skip the rest.  That's probably better than
+a fatal error.
+</pre>
+    </blockquote>
+    <br>
+    I had a look at io.c socketopen.<br>
+    It seems to do exactly what you suggested.<br>
+    It even honours the "type" and the "family" of the<br>
+    networking interface (IPV4/6 and TCP/UDP) that<br>
+    can be deduced form the /inet path.<br>
+    There are two nested "while" loops, the outer loop for the<br>
+    local port and the inner loop for the remote port.<br>
+    These nested loops try to open a connection for every<br>
+    combination of local and remote port (taking into account<br>
+    the hints/restrictions from /inet). Upon first successful<br>
+    connection, both loops are left with the socket left open.<br>
+    The loops go on looping as long as the connection<br>
+    build-up is unsuccessful (or no combinations left to try).<br>
+    <br>
+    The source code is a bit difficult to read because of<br>
+    the "gotos", the nested "breaks" and the "returns".<br>
+    But it looks clean and makes sense. Even the cleanup<br>
+    with the freeaddrinfo() system call seems Ok.<br>
+    Really not bad.<br>
+    <br>
+    <br>
+    <blockquote type="cite">
+      <pre wrap="">One thing that bothers me right now is that getaddrinfo() 
returns
+a linked list of struct addrinfo, and the gawk paradigm assumes that
+<i class="moz-txt-slash"><span class="moz-txt-tag">/</span>inet<span 
class="moz-txt-tag">/</span></i>... will only map to one possible connection, 
an (IPv?, address, port)
+triple.  This should be dealt with reasonably in the case that more
+than one struct addrinfo comes back. (Probably a fatal error.)
+</pre>
+    </blockquote>
+    <br>
+    As mentioned above, the current behaviour looks fine to me.<br>
+    But let me mention one side-effect that might confuse you<br>
+    if you use "strace" to look at what the interpreter actually does.<br>
+    When using the client and server example code, you will see<br>
+    several socket() systems calls as the nested loops do their<br>
+    work of trying all combinations. There is even one for SOCK_RAW.<br>
+    <blockquote><tt>strace ./gawk -f client.awk 2&gt;&amp;1 | grep
+        socket<br>
+        <br>
+      </tt><tt></tt><tt>socket(PF_NETLINK, SOCK_RAW, 0)         = 
3</tt><tt><br>
+      </tt><tt>socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK,
+        0) = 3</tt><tt><br>
+      </tt><tt>socket(PF_NETLINK, SOCK_RAW, 0)         = 3</tt><tt><br>
+      </tt><tt>socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 3</tt><tt><br>
+      </tt></blockquote>
+    This is ugly, probably annoying, but not fatal.<br>
+    What remains to be done is to remove the support for<br>
+    UDP in io.c as well as in the doc and to improve the conceptual<br>
+    description of TCP in the doc. Do we agree ?<br>
+    <br>
+    <br>
+  </body>
+</html>
+
+--------------010504090001020009000105--
+
+From address@hidden  Sun Apr  3 22:53:51 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id 3276F20C
+       for <address@hidden>; Sun,  3 Apr 2016 22:53:51 -0400 (EDT)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id 202BE6CC; Sun,  3 Apr 2016 22:53:51 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 8E8F9577
+       for <address@hidden>; Sun,  3 Apr 2016 22:53:50 -0400 (EDT)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 8E8F9577
+Authentication-Results: sv3.telemetry-investments.com; dmarc=none 
header.from=skeeve.com
+Received: from localhost ([::1]:56223 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1amueC-00013e-LC
+       for address@hidden; Sun, 03 Apr 2016 22:53:48 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:35230)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1amue9-00013V-DI
+       for address@hidden; Sun, 03 Apr 2016 22:53:46 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1amue5-0007wE-CR
+       for address@hidden; Sun, 03 Apr 2016 22:53:45 -0400
+Received: from mxout2.netvision.net.il ([194.90.9.21]:55275)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1amue5-0007vu-4i
+       for address@hidden; Sun, 03 Apr 2016 22:53:41 -0400
+MIME-version: 1.0
+Content-transfer-encoding: 7BIT
+Content-type: text/plain; CHARSET=US-ASCII
+Received: from skeeve.com ([93.173.16.221]) by mxout2.netvision.net.il
+       (Oracle Communications Messaging Server 7.0.5.30.0 64bit (built Oct 22
+       2013)) with ESMTPSA id <address@hidden> for
+       address@hidden; Mon, 04 Apr 2016 05:53:35 +0300 (IDT)
+Received: from skeeve.com (skeeve.com [127.0.0.1])
+       by skeeve.com (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id
+       u342rZO7003330; Mon, 4 Apr 2016 05:53:35 +0300
+Received: (from address@hidden)        by skeeve.com (8.14.4/8.14.4/Submit)
+       id u342rYxg003329;      Mon, 4 Apr 2016 05:53:34 +0300
+From: Aharon Robbins <address@hidden>
+Message-id: <address@hidden>
+Date: Mon, 04 Apr 2016 05:53:34 +0300
+To: address@hidden
+References: <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+In-reply-to: <address@hidden>
+User-Agent: Heirloom mailx 12.5 6/20/10
+X-detected-operating-system: by eggs.gnu.org: Solaris 10
+X-Received-From: 194.90.9.21
+Cc: address@hidden
+Subject: Re: [gawk-devel] UDP networking doesn't work?
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+X-Status: A
+Content-Length: 1273
+Lines: 44
+
+Hi Juergen.
+
+Thanks for the update. I'm glad the code is actually in reasonable shape.
+
+I set up a git branch for you to work in. It's not all that hard.
+You pretty much want to work as follows:
+
+       cd /path/to/your/copy/of/the/repo
+       make distclean
+       git pull
+       git checkout feature/improve-inet
+       # code, compile, test, fix doc
+       git add <list of changed files>
+       git commit
+       git push        # when there's something for everyone else to see
+       # continue with "code, git add, git commit, git push" until done
+
+Every once in a while, you will want to bring the branch up to date
+with master.  This isn't hard.  First, be sure you have no unsaved changes.
+Then:
+
+       make distclean
+       git checkout master && git pull # bring up to date
+       git checkout feature/improve-inet
+       git merge master
+       # Resolve any conflicts here. gvim or Emacs or ...
+       # git add <resolved files>
+       # git commit
+       git push
+
+That's really all there is to it.
+
+You will want to have up to date versions of the various tools, as
+listed in the NEWS file, including makeinfo.
+
+Andy - please coordinate with Juergen too if you have what to contribute.
+
+Starting by obsoleting /inet/udp is a good idea.  When that's ready
+it can be merged to master and then y'all can start on the reworking
+that Andy wants to do.
+
+Thanks!
+
+Arnold
+
+From address@hidden  Mon Apr  4 09:27:48 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id 4D9623C0
+       for <address@hidden>; Mon,  4 Apr 2016 09:27:48 -0400 (EDT)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id 465476C9; Mon,  4 Apr 2016 09:27:48 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 0ADE32AE
+       for <address@hidden>; Mon,  4 Apr 2016 09:27:47 -0400 (EDT)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 0ADE32AE
+Authentication-Results: sv3.telemetry-investments.com; dmarc=none 
header.from=telemetry-investments.com
+Authentication-Results: sv3.telemetry-investments.com;
+       dkim=fail reason="key not found in DNS" (0-bit key) 
header.d=telemetry-investments.com address@hidden header.b=2FDQeCmz
+Received: from localhost ([::1]:58623 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1an4Xh-0003dL-S8
+       for address@hidden; Mon, 04 Apr 2016 09:27:45 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:54244)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1an4Xe-0003dF-OF
+       for address@hidden; Mon, 04 Apr 2016 09:27:43 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1an4Xb-0004hH-IC
+       for address@hidden; Mon, 04 Apr 2016 09:27:42 -0400
+Received: from gw3a.telemetry-investments.com ([38.76.0.51]:51669
+       helo=sv3.telemetry-investments.com)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1an4Xb-0004gt-EO
+       for address@hidden; Mon, 04 Apr 2016 09:27:39 -0400
+Received: from ti129.telemetry-investments.com (ti129 [192.168.53.129])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id C51C344C;
+       Mon,  4 Apr 2016 09:27:36 -0400 (EDT)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=telemetry-investments.com; s=tele1409; t=1459776457;
+       bh=mX0+xH7BDTKMcWohU6wOtNj7nVpvVNl0VyjR1xNjpvQ=;
+       h=Date:From:To:Cc:Subject:References:In-Reply-To;
+       b=2FDQeCmzx9XKIZnj96BbW4CsCCyu8PiH4Dc/q+o/bxIkjbW+xRw4rg3Nm97Z01Bor
+       G7DjW4Gxr7kJEiPIODkCJ9xkvebZkCldibwo0AuT62D2+c+b2goZPmya3CukHFocJv
+       n1CDqwESISPJqwY6S1JOcE440/Hq0tP5tVZiHvZs=
+Received: by ti129.telemetry-investments.com (Postfix, from userid 300)
+       id 9AF723E0D; Mon,  4 Apr 2016 09:27:36 -0400 (EDT)
+Date: Mon, 4 Apr 2016 09:27:36 -0400
+From: "Andrew J. Schorr" <address@hidden>
+To: Aharon Robbins <address@hidden>
+Message-ID: <address@hidden>
+References: <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: inline
+In-Reply-To: <address@hidden>
+User-Agent: Mutt/1.5.23 (2014-03-12)
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
+X-Received-From: 38.76.0.51
+Cc: address@hidden
+Subject: Re: [gawk-devel] UDP networking doesn't work (and some thoughts
+ about TCP)
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.14
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: address@hidden
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 2783
+Lines: 55
+
+Hi,
+
+> Andy - please coordinate with Juergen too if you have what to contribute.
+> 
+> Starting by obsoleting /inet/udp is a good idea.  When that's ready
+> it can be merged to master and then y'all can start on the reworking
+> that Andy wants to do.
+
+Sorry for being AWOL. My day job takes all my attention lately.  I have no
+particularly view on whether we should get rid of /inet/udp, but if we keep it,
+we should try to make it work in a reasonable way. My main concern is with how
+tcp works. The current approach does not support the notion of listening for
+and accepting connections. This was done for the sake of simplicity and
+consistency with the udp approach, but it ignores the fact that serving TCP
+stream connections is conceptually quite different than responding to UDP
+packets. From an old email I sent about this:
+
+On Sun, Jun 30, 2013 at 05:19:24PM -0400, Andrew J. Schorr wrote:
+> 3. The tcp server logic was designed to be single-threaded.  If you try to 
read
+> input from a server socket, it waits for a client to connect, closes the
+> listener socket, and then processes I/O from the newly connected socket.  If 
I
+> could start over, I'd change the TCP server mechanism to work something like
+> this:
+> 
+>    server = "/inet/tcp/8080/0/0"
+>    while (1) {
+>       # wait for a client to connect
+>       server |& getline client
+>       # at this point, client contains the handle for the connected socket,
+>       # something like "/inet/tcp/8080/client-host/client-port", and the 
server
+>       # socket should still be open to accept new connections!
+>       while ((client |& getline x) > 0)
+>       printf "client %s says: %s\n", client, x
+>       close(client)
+>    }
+> 
+> If it had been done that way, it would be easy to use the new select
+> multiplexing mechanisms to service multiple connected clients at once.
+> Since it was not designed that way, I'm not sure how best to remedy this.
+> I guess we can add a function to open a socket to listen for connections,
+> and another to accept connections, but it may be painful to integrate this
+> into the existing socket I/O scheme.  A separate BSD-style API would be
+> easy to implement, but it seems suboptimal to have 2 different approaches
+> to networking.  Does anbody have any thoughts on how best to solve this?
+
+So if your goal is to retain compatibility with the existing TCP
+server design, then I'm not sure I have much to contribute. I guess another
+possibility would be to have a command-line option or environment option
+to control the TCP behavior to support both approaches. I think that
+the existing single-threaded TCP server implementation is too limited to
+be useful, so that's why I suspect that nobody is using it. It's fine for
+a simple demo, but how is it actually useful?
+
+Regards,
+Andy
+
+From address@hidden Mon Apr  4 15:55:03 2016
+Return-Path: <address@hidden>
+X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
+ ti9.telemetry-investments.com
+X-Spam-Level: 
+X-Spam-Status: No, score=-2.6 required=10.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW
+ autolearn=ham autolearn_force=no version=3.4.0
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+ by ti129.telemetry-investments.com (Postfix) with ESMTP id 7006420C
+ for <address@hidden>;
+ Mon,  4 Apr 2016 15:55:03 -0400 (EDT)
+Received: by sv3.telemetry-investments.com (Postfix)
+ id 670E6679; Mon,  4 Apr 2016 15:55:03 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from mxout2.netvision.net.il (mxout2.netvision.net.il [194.90.9.21])
+ by sv3.telemetry-investments.com (Postfix) with ESMTP id 1085135A
+ for <address@hidden>; Mon,  4 Apr 2016 15:55:02 -0400 (EDT)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 1085135A
+Authentication-Results: sv3.telemetry-investments.com;
+ dmarc=none header.from=skeeve.com
+MIME-version: 1.0
+Content-transfer-encoding: 7BIT
+Content-type: text/plain; CHARSET=US-ASCII
+Received: from skeeve.com ([93.173.16.221]) by mxout2.netvision.net.il
+ (Oracle Communications Messaging Server 7.0.5.30.0 64bit (built Oct 22 2013))
+ with ESMTPSA id <address@hidden> for
+ address@hidden; Mon, 04 Apr 2016 22:55:00 +0300 (IDT)
+Received: from skeeve.com (skeeve.com [127.0.0.1])
+ by skeeve.com (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id u34JsxOx003565; 
+ Mon, 4 Apr 2016 22:54:59 +0300
+Received: (from address@hidden)        by skeeve.com (8.14.4/8.14.4/Submit)
+ id u34JswLO003564;    Mon, 4 Apr 2016 22:54:58 +0300
+From: Aharon Robbins <address@hidden>
+Message-id: <address@hidden>
+Date: Mon, 04 Apr 2016 22:54:58 +0300
+To: address@hidden, address@hidden
+Subject: Re: [gawk-devel] UDP networking doesn't work (and some thoughts about
+ TCP)
+Cc: address@hidden, address@hidden
+References: <address@hidden>
+ <address@hidden>
+ <address@hidden>
+ <address@hidden> <address@hidden>
+ <address@hidden> <address@hidden>
+ <address@hidden>
+ <address@hidden> <address@hidden>
+ <address@hidden>
+In-reply-to: <address@hidden>
+User-Agent: Heirloom mailx 12.5 6/20/10
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: None (sv3.telemetry-investments.com: domain of address@hidden
+ does not designate permitted sender hosts)
+ receiver=sv3.telemetry-investments.com; client-ip=194.90.9.21;
+ envelope-from=<address@hidden>; helo=mxout2.netvision.net.il;
+X-Spambayes-Classification: ham; 0.00
+Status: RO
+Content-Length: 2893
+Lines: 69
+
+Hi Andy.
+
+> My main concern is with how
+> tcp works. The current approach does not support the notion of listening for
+> and accepting connections. This was done for the sake of simplicity and
+> consistency with the udp approach, but it ignores the fact that serving TCP
+> stream connections is conceptually quite different than responding to UDP
+> packets. From an old email I sent about this:
+>
+> On Sun, Jun 30, 2013 at 05:19:24PM -0400, Andrew J. Schorr wrote:
+> > 3. The tcp server logic was designed to be single-threaded.  If you try to 
read
+> > input from a server socket, it waits for a client to connect, closes the
+> > listener socket, and then processes I/O from the newly connected socket.  
If I
+> > could start over, I'd change the TCP server mechanism to work something 
like
+> > this:
+> > 
+> >    server = "/inet/tcp/8080/0/0"
+> >    while (1) {
+> >       # wait for a client to connect
+> >       server |& getline client
+> >       # at this point, client contains the handle for the connected socket,
+> >       # something like "/inet/tcp/8080/client-host/client-port", and the 
server
+> >       # socket should still be open to accept new connections!
+> >       while ((client |& getline x) > 0)
+> >     printf "client %s says: %s\n", client, x
+> >       close(client)
+> >    }
+> > 
+> > If it had been done that way, it would be easy to use the new select
+> > multiplexing mechanisms to service multiple connected clients at once.
+> > Since it was not designed that way, I'm not sure how best to remedy this.
+> > I guess we can add a function to open a socket to listen for connections,
+> > and another to accept connections, but it may be painful to integrate this
+> > into the existing socket I/O scheme.  A separate BSD-style API would be
+> > easy to implement, but it seems suboptimal to have 2 different approaches
+> > to networking.  Does anbody have any thoughts on how best to solve this?
+>
+> So if your goal is to retain compatibility with the existing TCP
+> server design, then I'm not sure I have much to contribute.
+
+I think this is actually rather easy to solve, by introducing
+a new namespace:
+
+    server = "/inetserv/tcp/8080/0/0"
+    while (1) {
+       # wait for a client to connect
+       getline client < server
+       # at this point, client contains the handle for the connected socket,
+       # something like "/inet/tcp/8080/client-host/client-port", and the 
server
+       # socket should still be open to accept new connections!
+       while ((client |& getline x) > 0)
+        printf "client %s says: %s\n", client, x
+       close(client)
+    }
+    close(server)
+
+To read handles it's better (IMHO) to use a < redirection, since
+it's a one way communication.
+
+In terms of plans, let's use the new branch to remove UDP. Once that's
+merged into master, we can use it for further standalone experimentation
+until everyone is happy.
+
+Thoughts?
+
+Thanks,
+
+Arnold
+
+
+From address@hidden  Sun Apr 10 18:46:09 2016
+Return-Path: <address@hidden>
+X-Original-To: address@hidden
+Delivered-To: address@hidden
+Received: from sv3.telemetry-investments.com (ti74 [192.168.58.74])
+       by ti129.telemetry-investments.com (Postfix) with ESMTP id 7887D2B2
+       for <address@hidden>; Sun, 10 Apr 2016 18:46:09 -0400 (EDT)
+Received: by sv3.telemetry-investments.com (Postfix)
+       id 664E169E; Sun, 10 Apr 2016 18:46:09 -0400 (EDT)
+Delivered-To: address@hidden
+Received: from lists.gnu.org (lists.gnu.org [208.118.235.17])
+       by sv3.telemetry-investments.com (Postfix) with ESMTP id 060592D7
+       for <address@hidden>; Sun, 10 Apr 2016 18:46:08 -0400 (EDT)
+DMARC-Filter: OpenDMARC Filter v1.3.1 sv3.telemetry-investments.com 060592D7
+Authentication-Results: sv3.telemetry-investments.com; dmarc=pass 
header.from=googlemail.com
+Authentication-Results: sv3.telemetry-investments.com;
+       dkim=pass (2048-bit key) header.d=googlemail.com address@hidden 
header.b=aTQiSxDP
+Received: from localhost ([::1]:36889 helo=lists.gnu.org)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>)
+       id 1apO7M-0002T2-6C
+       for address@hidden; Sun, 10 Apr 2016 18:46:08 -0400
+Received: from eggs.gnu.org ([2001:4830:134:3::10]:51154)
+       by lists.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1apO7J-0002R3-Gl
+       for address@hidden; Sun, 10 Apr 2016 18:46:06 -0400
+Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
+       (envelope-from <address@hidden>) id 1apO7F-0004Qw-Hc
+       for address@hidden; Sun, 10 Apr 2016 18:46:05 -0400
+Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:36088)
+       by eggs.gnu.org with esmtp (Exim 4.71)
+       (envelope-from <address@hidden>) id 1apO7F-0004Qo-As
+       for address@hidden; Sun, 10 Apr 2016 18:46:01 -0400
+Received: by mail-wm0-x244.google.com with SMTP id l6so17394391wml.3
+       for <address@hidden>; Sun, 10 Apr 2016 15:46:00 -0700 (PDT)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=googlemail.com; s=20120113;
+       h=from:subject:references:cc:message-id:date:user-agent:mime-version
+       :in-reply-to:content-transfer-encoding;
+       bh=VkLJf1sHk+OHjE9jns5+CXEDvxb0njer6a/EoiBLmSM=;
+       b=aTQiSxDP+WVbYOEaZI2cY0GAUnASPjRMBOjNa/SetAbjszzsn3hthpx3Avte4URdpa
+       ANS46fhFohKpj1RDo9xULP5A+o1qxRfv2FdpeZ0yHRGXOzEOy3AET3opMNfAm7TpLvEl
+       zWZlOZ3Z1aluEGlfz1P0obD609sI9a8AxQ+CoWykZMA3DwSOYIzb6MyG2FKl0POTPn4a
+       Qew9g0733I3i27V7OUTRGe5KKbDSlgfmV88apM9llvUjrjb8PQN7V7rJN6q07rEg7gHz
+       MF/qu6vkLCIFVyj5yhFsUTb0UaHGCzbO5pxyWvwWnPO5xSyoRDFFBalDPfhzFyoag+1K
+       6Wcg==
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+       d=1e100.net; s=20130820;
+       h=x-gm-message-state:from:subject:references:cc:message-id:date
+       :user-agent:mime-version:in-reply-to:content-transfer-encoding;
+       bh=VkLJf1sHk+OHjE9jns5+CXEDvxb0njer6a/EoiBLmSM=;
+       b=F1LxtAST2fPG9Buv+iVNdi4y7ZGcgwJGSVzcVPSVjnOKya0XGuJnTDQ9fr6FHDtTmR
+       Ycb+N1QGIGfNHCusa+Ehjk9TzG/acOMAGZ7d/JU98elS5Gl08812GWAw/9UrcihKHe8/
+       QxVDDw2Gak95t4PTtcZfRwR4jLbMjlvc/7KPXnBephrxRJL+c+BcV1llnaIBuT3VLHS4
+       5VDx25otV3JSFMbT6vADnW8VmZ302qBhkML/4xV4aTQJPrhYdihUq9+joUNpNZyP+4jN
+       aQGQx9LMIPTshVJ9/bvReWTzn82Ee7XC0gcH6FNSB+TcQylKMXQucb5v8a7wXMutL4Pm
+       ydzQ==
+X-Gm-Message-State: 
AD7BkJJdClPPZPXynqHXiriIe///0m2VkMapnhQOs2qWCEU0hKgHueCdtRi3a5NqxNFbbQ==
+X-Received: by 10.194.142.196 with SMTP id ry4mr20040110wjb.171.1460328360324; 
+       Sun, 10 Apr 2016 15:46:00 -0700 (PDT)
+Received: from [192.168.0.11] (ip5f5ac83d.dynamic.kabel-deutschland.de.
+       [95.90.200.61]) by smtp.googlemail.com with ESMTPSA id
+       q62sm14309810wmg.12.2016.04.10.15.45.59 for <address@hidden>
+       (version=TLSv1/SSLv3 cipher=OTHER);
+       Sun, 10 Apr 2016 15:45:59 -0700 (PDT)
+From: "=?UTF-8?Q?J=c3=bcrgen_Kahrs?=" <address@hidden>
+X-Google-Original-From: =?UTF-8?Q?J=c3=bcrgen_Kahrs?=
+       <address@hidden>
+References: <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden> <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+       <address@hidden>
+Cc: address@hidden
+Message-ID: <address@hidden>
+Date: Mon, 11 Apr 2016 00:45:58 +0200
+User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
+       Thunderbird/38.7.0
+MIME-Version: 1.0
+In-Reply-To: <address@hidden>
+Content-Type: text/plain; charset=windows-1252
+Content-Transfer-Encoding: 7bit
+X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
+X-Received-From: 2a00:1450:400c:c09::244
+Subject: Re: [gawk-devel] UDP networking doesn't work (and some thoughts
+ about TCP)
+X-BeenThere: address@hidden
+X-Mailman-Version: 2.1.21
+Precedence: list
+List-Id: "Internal discussion list for gawk development." <gawk-devel.gnu.org>
+List-Unsubscribe: <https://lists.gnu.org/mailman/options/gawk-devel>,
+       <mailto:address@hidden>
+List-Archive: <https://lists.gnu.org/mailman/private/gawk-devel/>
+List-Post: <mailto:address@hidden>
+List-Help: <mailto:address@hidden>
+List-Subscribe: <https://lists.gnu.org/mailman/listinfo/gawk-devel>,
+       <mailto:address@hidden>
+Errors-To: address@hidden
+Sender: "gawk-devel"
+       <address@hidden>
+X-SPF-Scan-By: smf-spf v2.0.2 - http://smfs.sf.net/
+Received-SPF: Pass (sv3.telemetry-investments.com: domain of address@hidden
+       designates 208.118.235.17 as permitted sender)
+       receiver=sv3.telemetry-investments.com; client-ip=208.118.235.17;
+       envelope-from=<address@hidden>; helo=lists.gnu.org;
+Status: RO
+Content-Length: 1427
+Lines: 31
+
+Am 04.04.2016 um 21:54 schrieb Aharon Robbins:
+> In terms of plans, let's use the new branch to remove UDP. Once that's
+> merged into master, we can use it for further standalone experimentation
+> until everyone is happy.
+>
+> Thoughts?
+
+I think Andrew is right with his fundamental disagreement.
+Andrew argued that the current TCP interface
+- is too simple (it cannot support anything but the most basic
+    kinds of applications)
+- is incompatible with the new "select" multiplexing mechanisms
+- could be replaced by a BSD-style API, perhaps under a
+    different namespace (as suggested by Arnold)
+
+This leads me to the following questions:
+1) Should an improved API retain compatibility with the old TCP API ?
+    Is the old TCP API worth the effort (is it such a good concept) ?
+2) Should any alternative API be implemented inside GAWK ?
+Anyone who wants to do serious work with TCP applications
+will probably answer with "NO" to these questions.
+ad 1: Stuffing parameters into an artificial path name helps
+         with setting static parameters, but cannot help with the
+         the dynamic behaviour (unforeseeable events and details)
+         of networking connections
+ad 2: A second networking API inside GAWK is indeed "suboptimal",
+         unless there was a proven brilliant API that only needed to be
+         taken over (I doubt there is)
+
+Perhaps the best place for a networking API is a separate extension.
+
+

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog        |    5 +
 improve-inet.mbx | 6362 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 6367 insertions(+)
 create mode 100644 improve-inet.mbx


hooks/post-receive
-- 
gawk



reply via email to

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