LOG.info("Assigning session id " + sessionId + " to connection to " + host + ":" + port);
try {
TTransport transport = new TFramedTransport(new TSocket(host, port));
transport.open();
TProtocol protocol = new TBinaryProtocol(transport);
ClientConsole.Client client = new ClientConsole.Client(protocol);
// Store the info about this RPC connection in the active sessions table.
UserSession session = new UserSession(sessionId, transport, client);
session.subscribeToClose(this);