Updated client and server to use two sockets

Also added handshake protocol.