Old code I wrote that wrapped C sockets in C++