Fork from: http://www.alhem.net/Sockets/download.html