public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Grant Edwards <grant.b.edwards@gmail.com>
To: ecos-discuss@ecos.sourceware.org
Subject: [ECOS] Re: BSD TCP connect() ignores SO_REUSEADDR option
Date: Tue, 30 Apr 2013 19:40:00 -0000	[thread overview]
Message-ID: <klp6mb$aqe$1@ger.gmane.org> (raw)
In-Reply-To: <klp4vo$r2b$1@ger.gmane.org>

On 2013-04-30, Grant Edwards <grant.b.edwards@gmail.com> wrote:

> I've recently noticed that when using the FreeBSD TCP stack, the
> connect() system call ignores the SO_REUSEADDRESS setting and returns
> EADDRINUSE when attempting to connect a TCP socket if a connection
> with the same (SrcIP,SrcPort,DstIP,DstPort) tuple is still hanging
> around in the TIME_WAIT state.

It appears that the work-around for this is to set the SO_LINGER
option with a timeout of 0 before calling close().  That reportedly
sends a RST instead of a FIN, and the socket doesn't hang around in
the TIME_WAIT state...

-- 
Grant Edwards               grant.b.edwards        Yow! Thousands of days of
                                  at               civilians ... have produced
                              gmail.com            a ... feeling for the
                                                   aesthetic modules --


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

      reply	other threads:[~2013-04-30 19:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-30 19:11 [ECOS] " Grant Edwards
2013-04-30 19:40 ` Grant Edwards [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='klp6mb$aqe$1@ger.gmane.org' \
    --to=grant.b.edwards@gmail.com \
    --cc=ecos-discuss@ecos.sourceware.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).