public Server(String host,int port){
        this.host = host;
        this.port = port;
        client = new Client(host, port, protocol, new TcpSessionFactory());
        client.getSession().addListener(this);
    }