From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 01CB8BB81 for ; Wed, 9 Nov 2005 15:36:49 +0100 (CET) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.190]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jA9EamTR020018 for ; Wed, 9 Nov 2005 15:36:48 +0100 Received: from [212.227.126.160] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1EZr43-0001Ml-00; Wed, 09 Nov 2005 15:36:39 +0100 Received: from [84.58.185.175] (helo=gate.lan.gerd-stolpmann.de) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1EZr42-0005oY-00; Wed, 09 Nov 2005 15:36:39 +0100 Received: from flakew.lan.gerd-stolpmann.de (flakew.lan.gerd-stolpmann.de [192.168.0.32]) by gate.lan.gerd-stolpmann.de (Postfix) with ESMTP id 47785C0B8; Wed, 9 Nov 2005 15:36:38 +0100 (CET) Subject: Re: [Caml-list] Error binding socket From: Gerd Stolpmann To: skaller Cc: Maurizio Colucci , caml-list In-Reply-To: <1131542978.8562.43.camel@rosella> References: <1131542978.8562.43.camel@rosella> Content-Type: text/plain; charset=UTF-8 Date: Wed, 09 Nov 2005 15:36:36 +0100 Message-Id: <1131546997.844.14.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 Content-Transfer-Encoding: quoted-printable X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:a6865a839c0178d9aa0ce41878507ea2 X-Miltered: at concorde with ID 43720980.004 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 gerd:01 stolpmann:01 donnerstag:01 gerd:01 struct:01 stolpmann:01 viktoriastr:01 64293:01 darmstadt:01 freeing:98 queued:98 wrote:01 unix:01 int:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Am Donnerstag, den 10.11.2005, 00:29 +1100 schrieb skaller: > On Wed, 2005-11-09 at 13:33 +0100, Maurizio Colucci wrote: > > Hi there. For my free tennis game (http://freetennis.sf.net), I get a= n > > error binding the socket to a port. (Unix_error 50, "bind"). The erro= r > > description is "address already in use". > >=20 > > This error only happens the *second* time I start the program. It is > > as if the port had not been freed and were still in use. The system i= s > > GNU/Linux Ubuntu Breezy. > >=20 > > However, if I wait about 1minute, or I start the program specifying a > > different port, the problem does not happen. It is as if Linux were > > freeing the port with a delay. >=20 > SO_LINGER Usually you need lingering only if the server socket closes the connection (fully) and wants to be sure everything is transmitted to the client. Only very few protocols need this. Gerd > Sets or gets the SO_LINGER option. The argument is a > linger structure. >=20 > struct linger { > int l_onoff; /* linger active */ > int l_linger; /* how many seconds to linger for *= / > }; >=20 > When enabled, a close(2) or shutdown(2) will not return > until all queued mes=E2=80=90 > sages for the socket have been successfully sent or the > linger timeout has been > reached. Otherwise, the call returns immediately and the > closing is done in the > background. When the socket is closed as part of > exit(2), it always lingers in > the background. >=20 >=20 --=20 ------------------------------------------------------------ Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany=20 gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de Telefon: 06151/153855 Telefax: 06151/997714 ------------------------------------------------------------