/** * Method to reconnect to the proxy when it decides not to maintain the connection * during handshake. * * @param nextFilter the next filter * @param request the http request */ private void reconnect(final NextFilter nextFilter, final HttpProxyRequest request) { LOGGER.debug("Reconnecting to proxy ..."); final ProxyIoSession proxyIoSession = getProxyIoSession(); // Fires reconnection proxyIoSession.getConnector().connect(new IoSessionInitializer<ConnectFuture>() { @Override public void initializeSession(final IoSession session, ConnectFuture future) { LOGGER.debug("Initializing new session: {}", session); session.setAttribute(ProxyIoSession.PROXY_SESSION, proxyIoSession); proxyIoSession.setSession(session); LOGGER.debug(" setting up proxyIoSession: {}", proxyIoSession); // Reconnection is done so we send the // request to the proxy proxyIoSession.setReconnectionNeeded(false); writeRequest0(nextFilter, request); } }); }
/** * Method to reconnect to the proxy when it decides not to maintain the connection * during handshake. * * @param nextFilter the next filter * @param request the http request */ private void reconnect(final NextFilter nextFilter, final HttpProxyRequest request) { LOGGER.debug("Reconnecting to proxy ..."); final ProxyIoSession proxyIoSession = getProxyIoSession(); // Fires reconnection proxyIoSession.getConnector().connect(new IoSessionInitializer<ConnectFuture>() { @Override public void initializeSession(final IoSession session, ConnectFuture future) { LOGGER.debug("Initializing new session: {}", session); session.setAttribute(ProxyIoSession.PROXY_SESSION, proxyIoSession); proxyIoSession.setSession(session); LOGGER.debug(" setting up proxyIoSession: {}", proxyIoSession); // Reconnection is done so we send the // request to the proxy proxyIoSession.setReconnectionNeeded(false); writeRequest0(nextFilter, request); } }); }
proxyIoSession.getConnector().connect( new IoSessionInitializer<ConnectFuture>() { public void initializeSession(final IoSession session,
/** * Signals that the handshake has finished. */ protected final void setHandshakeComplete() { synchronized (this) { handshakeComplete = true; } ProxyIoSession proxyIoSession = getProxyIoSession(); proxyIoSession.getConnector().fireConnected(proxyIoSession.getSession()).awaitUninterruptibly(); LOGGER.debug(" handshake completed"); // Connected OK try { proxyIoSession.getEventQueue().flushPendingSessionEvents(); flushPendingWriteRequests(); } catch (Exception ex) { LOGGER.error("Unable to flush pending write requests", ex); } }
/** * Signals that the handshake has finished. */ protected final void setHandshakeComplete() { synchronized (this) { handshakeComplete = true; } ProxyIoSession proxyIoSession = getProxyIoSession(); proxyIoSession.getConnector().fireConnected(proxyIoSession.getSession()).awaitUninterruptibly(); LOGGER.debug(" handshake completed"); // Connected OK try { proxyIoSession.getEventQueue().flushPendingSessionEvents(); flushPendingWriteRequests(); } catch (Exception ex) { LOGGER.error("Unable to flush pending write requests", ex); } }
/** * Signals that the handshake has finished. */ protected final void setHandshakeComplete() { synchronized (this) { handshakeComplete = true; } ProxyIoSession proxyIoSession = getProxyIoSession(); proxyIoSession.getConnector() .fireConnected(proxyIoSession.getSession()) .awaitUninterruptibly(); LOGGER.debug(" handshake completed"); // Connected OK try { proxyIoSession.getEventQueue().flushPendingSessionEvents(); flushPendingWriteRequests(); } catch (Exception ex) { LOGGER.error("Unable to flush pending write requests", ex); } }
if (evt.getType() == IoSessionEventType.CLOSED) { if (proxyIoSession.isAuthenticationFailed()) { proxyIoSession.getConnector().cancelConnectFuture(); discardSessionQueueEvents(); evt.deliverEvent();
if (evt.getType() == IoSessionEventType.CLOSED) { if (proxyIoSession.isAuthenticationFailed()) { proxyIoSession.getConnector().cancelConnectFuture(); discardSessionQueueEvents(); evt.deliverEvent();
if (evt.getType() == IoSessionEventType.CLOSED) { if (proxyIoSession.isAuthenticationFailed()) { proxyIoSession.getConnector().cancelConnectFuture(); discardSessionQueueEvents(); evt.deliverEvent();