<!-- MHonArc v2.4.4 --> <!--X-Subject: [MUD-Dev] Re: Quick socket question --> <!--X-From-R13: Quevf Uenl <ptNnzv-pt.UenlEntr.Sqzbagba.OP.QO> --> <!--X-Date: Sat, 7 Nov 1998 18:52:41 -0800 --> <!--X-Message-Id: 199811080250.TAA19426@ami-cg.GraySage.Edmonton.AB.CA --> <!--X-Content-Type: text/plain --> <!--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:cg#ami-cg,GraySage.Edmonton.AB.CA"> </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> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] <br clear=all><hr> <!--X-Body-Begin--> <!--X-User-Header--> <!--X-User-Header-End--> <!--X-TopPNI--> Date: [ <a href="msg00791.html">Previous</a> | <a href="msg00793.html">Next</a> ] Thread: [ <a href="msg00795.html">Previous</a> | <a href="msg00788.html">Next</a> ] Index: [ <A HREF="author.html#00792">Author</A> | <A HREF="#00792">Date</A> | <A HREF="thread.html#00792">Thread</A> ] <!--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>: Chris Gray <<A HREF="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</A>></LI> <LI><em>Date</em>: Sat, 7 Nov 1998 19:50:16 -0700</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> [Dr. Cat:] >I thought at first it was because I wasn't closing the socket when the >accept() problem I was having crashed it. But I did a proper operator >shutdown, which takes the bound socket and does shutdown(mastsock, 2) >and close(mastsock) before existing. Do I need to do anything more on >closing to make sure the port is freed up, even if there's some >recalcitrant user's machine out there still desperately trying to talk to >it? Or is there a setsockopt option I need to set differently? Or is >there a sysadmin tweak to change that timeout value? If anyone's dealt >with this issue under Linux before (or any other Unix that has the same >issue) I'd appreciate a pointer. :X) I still get a few delays of a minute or two, and sometimes I don't, but that is about the maximum. I'm running RedHat 5.1. Perhaps that's because I always manage to get the shutdown and close in properly. This is it, literally: static void killSocket(int s) { TRACE("killSocket", s); shutdown(s, 2); #if defined(_WIN32) closesocket(s); #elif defined(AMIGA) CloseSocket(s); #else close(s); #endif } One thing you could try (I thought I had it in!) is to use setsockopt with SO_REUSEADDR. -- Don't design inefficiency in - it'll happen in the implementation. - me Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA </PRE> <!--X-Body-of-Message-End--> <!--X-MsgBody-End--> <!--X-Follow-Ups--> <HR> <!--X-Follow-Ups-End--> <!--X-References--> <!--X-References-End--> <!--X-BotPNI--> <UL> <LI>Prev by Date: <STRONG><A HREF="msg00791.html">[MUD-Dev] Re: Quick socket question</A></STRONG> </LI> <LI>Next by Date: <STRONG><A HREF="msg00793.html">[MUD-Dev] Re: Quick socket question</A></STRONG> </LI> <LI>Prev by thread: <STRONG><A HREF="msg00795.html">[MUD-Dev] ScryMUD [CUSTOM] Released under GNU General Public License</A></STRONG> </LI> <LI>Next by thread: <STRONG><A HREF="msg00788.html">[MUD-Dev] Quick socket question</A></STRONG> </LI> <LI>Index(es): <UL> <LI><A HREF="index.html#00792"><STRONG>Date</STRONG></A></LI> <LI><A HREF="thread.html#00792"><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="00800" HREF="msg00800.html">[MUD-Dev] Quick socket answer</A></strong>, Dr. Cat <a href="mailto:cat#bga,com">cat#bga,com</a>, Sun 08 Nov 1998, 19:38 GMT <LI><strong><A NAME="00799" HREF="msg00799.html">[MUD-Dev] Rebol</A></strong>, Ling <a href="mailto:K.L.Lo-94#student,lboro.ac.uk">K.L.Lo-94#student,lboro.ac.uk</a>, Sun 08 Nov 1998, 17:06 GMT <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> </UL> </LI> </UL></BLOCKQUOTE> </ul> <hr> <center> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] </center> <hr> </body> </html>