Finding the state of TCP/IP Sockets on Linux
It is not possible through the sockets API to find the connection state of a socket. But on Linux there is a way, a user space way, to find the connection state of a socket. Network information in the Proc…
Adding and Removing Routes in the Linux Routing Table
We will go through how to add and remove null routes in c++, though there is a lot more you can do with Linux’ routing tables. For this project I want to use the routing tables like a firewall. I…
Fixing File Descriptor Leaks in Long-Lived Servers
So you’ve created a socket server that opens sockets over TCP/IP. After running it for a few hours under heavy load the operating system kills your process with the message “Too many open files”. What happened? The problem On most…