| Summary: | connect(2) can yield EWOULDBLOCK/EAGAIN | ||
|---|---|---|---|
| Product: | Documentation | Reporter: | Ronald F. Guilmette <rfg> |
| Component: | Books & Articles | Assignee: | Wes Peters <wes> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | Latest | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Ronald F. Guilmette
2001-01-07 07:30:01 UTC
A brief follow-up on my own PR. I dug around in the networking parts of the kernel and found that what was probably happening to cause EAGAIN errors to be issued in response to connect(2) call was a absence of available (auto assigned) port numbers for outgoing connections. /sbin/sysctl -a says (under default conditions): net.inet.ip.portrange.first: 1024 net.inet.ip.portrange.last: 5000 This leaves less than 4000 available auto-assigned port number for outgoing connections. It appears that if those all get used up then connect(2) will start to yield -1 with errno set to EAGAIN. This should, of course, be documented in the ERRORS section of the connect(2) man page. Increasing the currently set value of net.inet.ip.portrange.last (via sysctl) seems to make the problem go away. Responsible Changed From-To: freebsd-doc->wes@freebsd.org I'll shepherd this one, I've recently commited a fix to the code. Responsible Changed From-To: wes@freebsd.org->wes s/wes@freebsd.org/wes/ Could this bug be closed? It looks like wes@ fixed it 5 years ago. Cheers, - Graham Percival State Changed From-To: open->feedback Committed fix to man page, should be closed after verification. State Changed From-To: feedback->closed Feedback timeout, close this (finally). |