Netdev List
 help / color / mirror / Atom feed
* connect() sometimes succeeds when it shouldn't
@ 2010-02-18 19:47 Bruce Cran
  2010-02-18 23:09 ` Ilpo Järvinen
  0 siblings, 1 reply; 3+ messages in thread
From: Bruce Cran @ 2010-02-18 19:47 UTC (permalink / raw)
  To: netdev

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-19 10:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-18 19:47 connect() sometimes succeeds when it shouldn't Bruce Cran
2010-02-18 23:09 ` Ilpo Järvinen
2010-02-19 10:55   ` Bruce Cran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox