/** * Factory method for new ConnectionManager (used by other projects like cometd) * * @return the ConnectionManager instance to use */ protected ConnectionManager newConnectionManager() { return new ConnectionManager(this); }
/** * Factory method for new WebSocketClientSelectorManager (used by other projects like cometd) * * @param client * the client used to create the WebSocketClientSelectorManager * @return the new WebSocketClientSelectorManager */ protected WebSocketClientSelectorManager newWebSocketClientSelectorManager(WebSocketClient client) { return new WebSocketClientSelectorManager(client); }
private void notifyConnect(ClientUpgradeResponse response) { connectPromise.setResponse(response); }
@Override protected void doStart() throws Exception { selector = newWebSocketClientSelectorManager(client); selector.setSslContextFactory(client.getSslContextFactory()); selector.setConnectTimeout(client.getConnectTimeout()); addBean(selector); super.doStart(); }
public UpgradeConnection(EndPoint endp, Executor executor, ConnectPromise connectPromise) { super(endp,executor); this.connectPromise = connectPromise; this.bufferPool = connectPromise.getClient().getBufferPool(); this.request = connectPromise.getRequest(); // Setup the parser this.parser = new HttpResponseHeaderParser(); }
public ConnectPromise connect(WebSocketClient client, EventDriver driver, ClientUpgradeRequest request) { URI toUri = request.getRequestURI(); String hostname = toUri.getHost(); if (isVirtualConnectionPossibleTo(hostname)) { return new VirtualConnect(client,driver,request); } return new PhysicalConnect(client,driver,request); }
@Override public void onClose() { super.onClose(); ConnectionManager connectionManager = connectPromise.getClient().getConnectionManager(); connectionManager.removeSession(getSession()); }
public UpgradeConnection newUpgradeConnection(SocketChannel channel, EndPoint endPoint, ConnectPromise connectPromise) { WebSocketClient client = connectPromise.getClient(); Executor executor = client.getExecutor(); UpgradeConnection connection = new UpgradeConnection(endPoint,executor,connectPromise); return connection; }
@Override public void onOpen() { super.onOpen(); // TODO: handle timeout getExecutor().execute(new SendUpgradeRequest()); }
@Override public InetSocketAddress getLocalAddress() { return getEndPoint().getLocalAddress(); }
@Override protected void doStart() throws Exception { selector = newWebSocketClientSelectorManager(client); selector.setSslContextFactory(client.getSslContextFactory()); selector.setConnectTimeout(client.getConnectTimeout()); addBean(selector); super.doStart(); }
public UpgradeConnection(EndPoint endp, Executor executor, ConnectPromise connectPromise) { super(endp,executor); this.connectPromise = connectPromise; this.bufferPool = connectPromise.getClient().getBufferPool(); this.request = connectPromise.getRequest(); // Setup the parser this.parser = new HttpResponseHeaderParser(); }
public ConnectPromise connect(WebSocketClient client, EventDriver driver, ClientUpgradeRequest request) { URI toUri = request.getRequestURI(); String hostname = toUri.getHost(); if (isVirtualConnectionPossibleTo(hostname)) { return new VirtualConnect(client,driver,request); } return new PhysicalConnect(client,driver,request); }
@Override public void onClose() { super.onClose(); ConnectionManager connectionManager = connectPromise.getClient().getConnectionManager(); connectionManager.removeSession(getSession()); }
public UpgradeConnection newUpgradeConnection(SocketChannel channel, EndPoint endPoint, ConnectPromise connectPromise) { WebSocketClient client = connectPromise.getClient(); Executor executor = client.getExecutor(); UpgradeConnection connection = new UpgradeConnection(endPoint,executor,connectPromise); return connection; }
@Override public void onOpen() { super.onOpen(); // TODO: handle timeout getExecutor().execute(new SendUpgradeRequest()); }
@Override public InetSocketAddress getRemoteAddress() { return getEndPoint().getRemoteAddress(); }
/** * Factory method for new ConnectionManager (used by other projects like cometd) * * @return the ConnectionManager instance to use */ protected ConnectionManager newConnectionManager() { return new ConnectionManager(this); }
/** * Factory method for new WebSocketClientSelectorManager (used by other projects like cometd) * * @param client * the client used to create the WebSocketClientSelectorManager * @return the new WebSocketClientSelectorManager */ protected WebSocketClientSelectorManager newWebSocketClientSelectorManager(WebSocketClient client) { return new WebSocketClientSelectorManager(client); }
private void notifyConnect(ClientUpgradeResponse response) { connectPromise.setResponse(response); }