private void closeConnections() { for (Session session : sessions) session.goAway(new GoAwayInfo(), Callback.Adapter.INSTANCE); sessions.clear(); }
void closeSessions() { for (Session session : sessions) session.goAway(new GoAwayInfo(), Callback.Adapter.INSTANCE); sessions.clear(); }
private void close(Stream stream) { stream.getSession().goAway(); }
@Override public void flush(long maxIdleTime) throws IOException { try { Buffer content = getContentBuffer(); while (content != null) { DataInfo dataInfo = toDataInfo(content, closed); logger.debug("HTTP < {} bytes of content", dataInfo.length()); stream.data(dataInfo).get(maxIdleTime, TimeUnit.MILLISECONDS); content.clear(); _bypass = false; content = getContentBuffer(); } } catch (TimeoutException x) { stream.getSession().goAway(); throw new EOFException("write timeout"); } catch (InterruptedException x) { throw new InterruptedIOException(); } catch (ExecutionException x) { throw new IOException(x.getCause()); } }
private Session produceSession(String host, short version, InetSocketAddress address) { try { Session session = serverSessions.get(host); if (session == null) { SPDYClient client = factory.newSPDYClient(version); session = client.connect(address, sessionListener).get(getConnectTimeout(), TimeUnit.MILLISECONDS); logger.debug("Proxy session connected to {}", address); Session existing = serverSessions.putIfAbsent(host, session); if (existing != null) { session.goAway(getTimeout(), TimeUnit.MILLISECONDS, new Handler.Adapter<Void>()); session = existing; } } return session; } catch (Exception x) { logger.debug(x); return null; } }
private Session produceSession(String host, short version, InetSocketAddress address) { try { Session session = serverSessions.get(host); if (session == null) { SPDYClient client = factory.newSPDYClient(version); session = client.connect(address, sessionListener); if (LOG.isDebugEnabled()) LOG.debug("Proxy session connected to {}", address); Session existing = serverSessions.putIfAbsent(host, session); if (existing != null) { session.goAway(new GoAwayInfo(), Callback.Adapter.INSTANCE); session = existing; } } return session; } catch (Exception x) { LOG.debug(x); return null; } }
stream.getSession().goAway(); throw new EOFException("read timeout");