
Sockets in a Bind: Troubleshooting Port Exhaustion in Heroku's Routing Layer - edmorley
https://engineering.heroku.com/blogs/2017-03-30-sockets-in-a-bind/
======
zimbatm
The linked article does a much better job of explaining the problem. Just read
this one: [https://idea.popcount.org/2014-04-03-bind-before-
connect/](https://idea.popcount.org/2014-04-03-bind-before-connect/)

------
Buge
That C code has a buffer overflow. Also they call atoi unnecessarily in each
loop iteration.

------
skinowski
A better solution would be relatively new socket option:

IP_BIND_ADDRESS_NO_PORT

[https://www.mail-
archive.com/netdev@vger.kernel.org/msg66879...](https://www.mail-
archive.com/netdev@vger.kernel.org/msg66879.html)

------
vor1968
This type of thing would not have been an issue 15 years ago. This is Richard
Stevens socket programming 101.

