The below file is REALLY OLD! Instead, check out the library I put together at https://github.com/navarr/Sockets