mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* possible causes for EADDRINUSE in client code
@ 2011-12-06 12:11 Steven Seagull
  0 siblings, 0 replies; only message in thread
From: Steven Seagull @ 2011-12-06 12:11 UTC (permalink / raw)
  To: linux-kernel

Hi!

I'm running a 2.6.26 kernel where I have to create short-lived TCP
connections with a high frequency. In order to do this, I am using
non-blocking sockets which are bound to different IP addresses in a
round-robin manner, and to port 0, so the kernel can choose a free
local port.

Now I observed that I am getting EADDRINUSE errors on the bind system
call, even though there should be ports left according to the current
net.ipv4.ip_local_port_range sysctl setting.

I tried to enumerate the used ports at the time of the error using
netstat, which shows only rather few ports being in use, but I
realize that this is an inaccurate measure because it takes time for
netstat to be forked and run.

What I wonder is: Is there any limit beyond
net.ipv4.ip_local_port_range which may lead to EADDRINUSE errors?
Maybe any limits in the kernel data structures I should be aware of
when working with huge amounts of TCP connections?

Thanks!

--
Steven


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-12-06 12:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-06 12:11 possible causes for EADDRINUSE in client code Steven Seagull

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

Powered by JetHome