@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. }
/** 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); }