From: Steven Seagull <steven7779@gmx.net>
To: linux-kernel@vger.kernel.org
Subject: possible causes for EADDRINUSE in client code
Date: Tue, 6 Dec 2011 12:11:26 +0000 (UTC) [thread overview]
Message-ID: <jbl0pd$g9q$1@dough.gmane.org> (raw)
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
reply other threads:[~2011-12-06 12:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='jbl0pd$g9q$1@dough.gmane.org' \
--to=steven7779@gmx.net \
--cc=linux-kernel@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
Powered by JetHome