SocketAddress address = endpoint.getAddress();
connector = endpoint.getConnector();
if (LOG.isDebugEnabled()) {
LOG.debug("Creating connector to address: " + address + " using connector: " + connector + " timeout: " + timeout + " millis.");
}
IoHandler ioHandler = new ResponseHandler(endpoint);
// connect and wait until the connection is established
ConnectFuture future = connector.connect(address, ioHandler, endpoint.getConnectorConfig());
future.join();
session = future.getSession();
}