Netdev List
 help / color / mirror / Atom feed
From: Bruce Cran <bruce@cran.org.uk>
To: netdev@vger.kernel.org
Subject: connect() sometimes succeeds when it shouldn't
Date: Thu, 18 Feb 2010 19:47:10 +0000	[thread overview]
Message-ID: <201002181947.11125.bruce@cran.org.uk> (raw)

Hi

I've found that if I run a program that does lots of calls to connect() then 
it will eventually succeed when there's no server listening. For SCTP it takes 
a few thousand, for TCP up to a couple of million.  I first came across the 
problem in Windows, where the connection was being processed so quickly that 
by the time the handler function had finished, the 'connecting' flag had 
already been reset, which wasn't expected. I've not checked the Linux sources 
to see if something similar is happening though.

The machine I tested it on was running a 2.6.32 i686 kernel.

The test code can be found at 
http://www.cran.org.uk/~brucec/linux/badconnect.c

-- 
Bruce Cran

             reply	other threads:[~2010-02-18 19:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-18 19:47 Bruce Cran [this message]
2010-02-18 23:09 ` connect() sometimes succeeds when it shouldn't Ilpo Järvinen
2010-02-19 10:55   ` Bruce Cran

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=201002181947.11125.bruce@cran.org.uk \
    --to=bruce@cran.org.uk \
    --cc=netdev@vger.kernel.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