1998Q4/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Re: Quick socket question -->
<!--X-From-R13: Pra Uerrne <terrneNploreuvtujnl.arg> -->
<!--X-Date: Sat, 7 Nov 1998 14:45:40 &#45;0800 -->
<!--X-Message-Id: Pine.LNX.3.96.981107153230.24280A&#45;100000#shamen,cyberhighway.net -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 199811072106.PAA12088#zoom,bga.com -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, [MUD-Dev] Re: Quick socket question</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:greear#cyberhighway,net">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00788.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00790.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00788.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00790.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00789">Author</A>
&nbsp;|&nbsp;<A HREF="#00789">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00789">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] Re: Quick socket question</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Subject</em>: [MUD-Dev] Re: Quick socket question</LI>
<LI><em>From</em>: Ben Greear &lt;<A HREF="mailto:greear#cyberhighway,net">greear#cyberhighway,net</A>&gt;</LI>
<LI><em>Date</em>: Sat, 7 Nov 1998 15:36:57 -0700 (MST)</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
I run on Slackware, 3.3 right now, which is older than redhat 5.0.

If I do a proper shutdown (with the close(socket_descriptor) call),
then I can re-bind to it in a matter of seconds.

Make sure you are checking the return values for all such system
calls.

Also, I log-out every connected descriptor before I try to close
the main listening socket.  That might have something to do with
it.

Ben

On Sat, 7 Nov 1998, Dr. Cat wrote:

&gt; Well, we were going to install Solaris 86 on the Furcadia server machine 
&gt; to replace the buggy older version of BSDI it had on it.  But the 
&gt; sysadmin out there suggested going to Red Hat Linux instead, because it's 
&gt; a BDS family rather than a SYSV family, and there might be fewer 
&gt; problems.  I agreed.  I don't know how hard getting it going on SYSV 
&gt; would have been, but I know my O'Reilly "Using C on the Unix system" is 
&gt; so old that it says Berkeley Unixes have sockets and SYSV don't!  Surely 
&gt; SYSV has to have sockets now, what with this "internet" thing having 
&gt; gotten so popular since this book was written - don't they?
&gt; 
&gt; Anyway, I got a couple compatibility problems involving select() and 
&gt; accept() worked out, but I've noticed the return of a problem we 
&gt; sometimes had under Linux with the old DragonSpires server, which is the 
&gt; ancestor of the Furcadia server code.  After the game is shut down or the 
&gt; server code crashes, and it tries to restart, it fails to bind the port 
&gt; for the next 15-20 minutes.  This is an improvement over the Linux of 4 
&gt; years ago, which apparently didn't have a timeout for this case and would 
&gt; leave the game unaccessible for hours, days, or potentially forever until 
&gt; I could successfully beg the uncooperative sysadmin of that system for a 
&gt; reboot!  Still, I'd like to fix this problem if I can.
&gt; 
&gt; I thought at first it was because I wasn't closing the socket when the 
&gt; accept() problem I was having crashed it.  But I did a proper operator 
&gt; shutdown, which takes the bound socket and does shutdown(mastsock, 2)
&gt; and close(mastsock) before existing.  Do I need to do anything more on 
&gt; closing to make sure the port is freed up, even if there's some 
&gt; recalcitrant user's machine out there still desperately trying to talk to 
&gt; it?  Or is there a setsockopt option I need to set differently?  Or is 
&gt; there a sysadmin tweak to change that timeout value?  If anyone's dealt 
&gt; with this issue under Linux before (or any other Unix that has the same 
&gt; issue) I'd appreciate a pointer.  :X)
&gt; 
&gt; *-------------------------------------------**-----------------------------* 
&gt;    Dr. Cat / Dragon's Eye Productions       ||       Free alpha test:
&gt; *-------------------------------------------**  <A  HREF="http://www.bga.com/furcadia">http://www.bga.com/furcadia</A>
&gt;   Furcadia - a new graphic mud for PCs!     ||  Let your imagination soar!
&gt; *-------------------------------------------**-----------------------------*
&gt; 
&gt; P.S. I've been to busy to reply to anything on the list, but Raph, I 
&gt; really liked the Laws page you set up, and I sent the URL to all of our 
&gt; volunteer staff and to some friends to browse through.  Though I would 
&gt; have worded that stamp collector thing a lot differently.  I'm still 
&gt; waiting for that lunch if you want to talk about how to revise that or 
&gt; anything.  :X)
&gt; 
&gt; -- 
&gt; MUD-Dev: Advancing an unrealised future.
&gt; 

Ben Greear (greear#cyberhighway,net)  <A  HREF="http://www.primenet.com/~greear">http://www.primenet.com/~greear</A> 
Author of ScryMUD:  mud.primenet.com 4444
<A  HREF="http://www.primenet.com/~greear/ScryMUD/scry.html">http://www.primenet.com/~greear/ScryMUD/scry.html</A>




</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00788" HREF="msg00788.html">[MUD-Dev] Quick socket question</A></STRONG>
<UL><LI><EM>From:</EM> "Dr. Cat" &lt;cat#bga,com&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00788.html">[MUD-Dev] Quick socket question</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00790.html">[MUD-Dev] Re: Quick socket question</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00788.html">[MUD-Dev] Quick socket question</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00790.html">[MUD-Dev] Re: Quick socket question</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00789"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00789"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><strong><A NAME="00796" HREF="msg00796.html">[MUD-Dev] Re: ScryMUD [CUSTOM] Released under GNU General Public License</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sun 08 Nov 1998, 06:25 GMT
<LI><strong><A NAME="00795" HREF="msg00795.html">[MUD-Dev] ScryMUD [CUSTOM] Released under GNU General Public License</A></strong>, 
Ben Greear <a href="mailto:greear#cyberhighway,net">greear#cyberhighway,net</a>, Sun 08 Nov 1998, 05:55 GMT
<LI><strong><A NAME="00792" HREF="msg00792.html">[MUD-Dev] Re: Quick socket question</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sun 08 Nov 1998, 02:52 GMT
<LI><strong><A NAME="00788" HREF="msg00788.html">[MUD-Dev] Quick socket question</A></strong>, 
Dr. Cat <a href="mailto:cat#bga,com">cat#bga,com</a>, Sat 07 Nov 1998, 21:27 GMT
<UL>
<LI><strong><A NAME="00789" HREF="msg00789.html">[MUD-Dev] Re: Quick socket question</A></strong>, 
Ben Greear <a href="mailto:greear#cyberhighway,net">greear#cyberhighway,net</a>, Sat 07 Nov 1998, 22:45 GMT
</LI>
<LI><strong><A NAME="00790" HREF="msg00790.html">[MUD-Dev] Re: Quick socket question</A></strong>, 
Jon Leonard <a href="mailto:jleonard#divcom,slimy.com">jleonard#divcom,slimy.com</a>, Sat 07 Nov 1998, 22:48 GMT
<UL>
<LI><strong><A NAME="00791" HREF="msg00791.html">[MUD-Dev] Re: Quick socket question</A></strong>, 
Petri Virkkula <a href="mailto:pvirkkul#iki,fi">pvirkkul#iki,fi</a>, Sat 07 Nov 1998, 23:24 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00793" HREF="msg00793.html">[MUD-Dev] Re: Quick socket question</A></strong>, 
J C Lawrence <a href="mailto:claw#kanga,nu">claw#kanga,nu</a>, Sun 08 Nov 1998, 04:02 GMT
<UL>
<LI><strong><A NAME="00803" HREF="msg00803.html">[MUD-Dev] Re: Quick socket question</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Tue 10 Nov 1998, 02:01 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>