public void Connection(Connection connection)
        {
            transportLayer = new DataTransport(connection, socket);
            transportLayer.Send(new byte[] { 32, 32 });

            byte[] auth = new byte[2];
            socket.Receive(auth);
            if (auth[0] == 32 && auth[1] == 32)
                transportLayer.StartPing();
            else
                throw new Exception("Invalid handshake with server");

            connected = true;
            _connection = connection;
        }
 public DataTransport(Connection clientObj, Socket socketObj)
 {
     client = clientObj;
     socket = socketObj;
 }