From owner-mudos-bugs@athens.imaginary.com  Thu Feb 27 04:11:39 1997
Received: from athens.imaginary.com by franck.Princeton.EDU via ESMTP (951211.SGI.8.6.12.PATCH1502/940406.SGI.AUTO)
	for <tim@franck.Princeton.EDU> id EAA01699; Thu, 27 Feb 1997 04:11:38 -0500
Received: (from daemon@localhost) by athens.imaginary.com (8.8.2/8.7.2) id CAA02417 for mudos-bugs-resend; Thu, 27 Feb 1997 02:57:25 -0600 (CST)
Received: from grog.lab2.cc.wmich.edu (root@grog.lab2.cc.wmich.edu [141.218.23.75]) by athens.imaginary.com (8.8.2/8.7.2) with ESMTP id CAA02412 for <mudos-bugs@imaginary.com>; Thu, 27 Feb 1997 02:57:17 -0600 (CST)
Received: from jihad (pm272-12.dialip.mich.net [198.108.130.32])
	by grog.lab2.cc.wmich.edu (8.8.5/8.8.5) with SMTP id EAA10556
	for <mudos-bugs@imaginary.com>; Thu, 27 Feb 1997 04:07:18 -0500 (EST)
Message-Id: <1.5.4.32.19970227090719.0067e894@lab2.cc.wmich.edu>
X-Sender: x6hartwi@lab2.cc.wmich.edu
X-Mailer: Windows Eudora Light Version 1.5.4 (32)
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Thu, 27 Feb 1997 04:07:19 -0500
To: mudos-bugs@imaginary.com
From: Skeeter Hartwig <x6hartwi@lab2.cc.wmich.edu>
Subject: v22.1b1 socket problems
Sender: owner-mudos-bugs@imaginary.com
Precedence: bulk
Reply-To: mudos-bugs@imaginary.com
Status: RO

MudOS version: v22.1b1
OS version: Redhat Linux 4.1 (Kernel 2.0.27)

Ok, I've run into a couple UDP socket problems.  The first isn't that bad,
but the second is rather crippling...

As background, my mud is on the old UDP-style Amylaar/CD type intermud
system.  When the inet daemon starts up, it sends a ping requests to all the
muds that are in our hosts file.  Oh yeah and I probably should mention the
method of the socket use.  When the inet daemon starts, it creates a UDP
socket and binds it to a port for 'listening.'  It creates another socket
that is used for all 'outgoing' socket_write()s (It's left open all the
time, just gets re-used).  The first socket appears to work perfectly and
does not misbehave.  The second socket is the culprit I will be referring to
below when I talk about socket_write()s and socket closings.

The first problem is that during this initial pinging, a couple of the
socket_write()s return an error of -27:

#define EESENDTO        -27     /* Problem with sendto */

Which seems to correlate with the following error in the runtime log:

System Error: socket_write: sendto:Connection refused

Anyway, what the daemon does is just a foreach() loop that sends a UDP
socket_write() to all the addresses in the hosts file.  If I change this
loop to do a call_out() to the socket_write() so that each socket_write() is
2 seconds apart, the -27 errors do not happen.  Is the socket getting
'jammed up' or something with too much at once?

The second problem is even more odd and pretty much cripples the intermud
system.  During the initial ping loop, a couple of the addresses, when a
socket_write() is done to them, somehow for some reason CLOSE the socket
during or after the socket_write(), without reporting any error whatsoever.
Subsequent socket_write()s return (probably to be expected) a -6 error:

#define EEBADF           -6     /* Descriptor is invalid */

And the following in the runtime log:

socket_read_select_handler: read on unbound socket 1

The two addresses that do this are ones that do it each and every time a
socket_write() is sent to them, whether it is done during an initial ping
loop or otherwise.  All the other addresses seem to work fine for
socket_write() during the initial ping loop.  However, subsequent
socket_write()s (apparently without pattern, haven't looked into it that
deeply yet though) to other addresses sometimes also exhibit this behavior
of silently closing the socket.  It doesn't take long for this to happen, so
the probability of any particular socket_write() doing this must be high.

Anyway, I had the socket closing problem under FreeBSD, but it was VERY
sporadic, like it would happen maybe once a week or something.  It wasn't
that big of a deal, and I think I only talked to you about it once.  It's a
more serious problem now with Linux, so I'm wondering what's up with it...

-Jihad@IE,Lima Bean,Mayhem

