caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: skaller <skaller@users.sourceforge.net>
Cc: Maurizio Colucci <maurizio.colucci@gmail.com>,
	caml-list <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Error binding socket
Date: Wed, 09 Nov 2005 15:36:36 +0100	[thread overview]
Message-ID: <1131546997.844.14.camel@localhost.localdomain> (raw)
In-Reply-To: <1131542978.8562.43.camel@rosella>

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 an
> > error binding the socket to a port. (Unix_error 50, "bind"). The error
> > description is "address already in use".
> > 
> > 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 is
> > GNU/Linux Ubuntu Breezy.
> > 
> > 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.
> 

>        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.
> 
>               struct linger {
>                   int   l_onoff;    /* linger active */
>                   int   l_linger;   /* how many seconds to linger for */
>               };
> 
>               When enabled, a close(2) or shutdown(2) will not return
> until  all  queued  mes‐
>               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.
> 
> 
-- 
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany 
gerd@gerd-stolpmann.de          http://www.gerd-stolpmann.de
Telefon: 06151/153855                  Telefax: 06151/997714
------------------------------------------------------------


      reply	other threads:[~2005-11-09 14:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-09 12:33 Maurizio Colucci
2005-11-09 12:55 ` [Caml-list] " Gerd Stolpmann
2005-11-09 13:02   ` Maurizio Colucci
2005-11-09 13:29 ` skaller
2005-11-09 14:36   ` Gerd Stolpmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1131546997.844.14.camel@localhost.localdomain \
    --to=info@gerd-stolpmann.de \
    --cc=caml-list@yquem.inria.fr \
    --cc=maurizio.colucci@gmail.com \
    --cc=skaller@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).