Added support for custom sockets

The socket is assumed to have connected to the server, but done nothing
else.