@Override
 public void responseSent(NHttpConnection conn, HttpResponse response) {
   HttpIOSession session = HttpContextParams.getIOSession(conn.getContext());
   session.setSocketTimeout(SharingSettings.PERSISTENT_HTTP_CONNECTION_TIMEOUT.getValue());
   session.setThrottle(null);
   conn.requestInput(); // make sure the new socket timeout is used.
 }
Beispiel #2
0
 public void connectionOpen(final NHttpConnection conn) {
   logger.info(
       "Connection from "
           + conn.getContext()
               .getAttribute(
                   ExecutionContext.HTTP_TARGET_HOST) // conn.getInetAddress().getHostName()
       );
 }
  /** Handles an incoming HTTP push request. This needs to be called from the NIO thread. */
  public void acceptConnection(Socket socket, HTTPConnectionData data) {
    assert NIODispatcher.instance().isDispatchThread();

    if (getReactor() == null) {
      LOG.warn("Received upload request before reactor was initialized");
      return;
    }

    NHttpConnection conn = getReactor().acceptConnection(null, socket);
    if (conn != null) HttpContextParams.setConnectionData(conn.getContext(), data);
  }