Example usage for org.apache.http.nio NHttpServerEventHandler timeout

List of usage examples for org.apache.http.nio NHttpServerEventHandler timeout

Introduction

In this page you can find the example usage for org.apache.http.nio NHttpServerEventHandler timeout.

Prototype

void timeout(NHttpServerConnection conn) throws IOException;

Source Link

Document

Triggered when no input is detected on this connection over the maximum period of inactivity.

Usage

From source file:org.apache.synapse.transport.passthru.core.MultiListenerServerIODispatch.java

@Override
protected void onTimeout(final DefaultNHttpServerConnection defaultNHttpServerConnection) {
    int localPort = defaultNHttpServerConnection.getLocalPort();
    NHttpServerEventHandler handler = handlers.get(localPort);
    try {/*from   ww  w  . j a va2s .  c  o  m*/
        handler.timeout(defaultNHttpServerConnection);
    } catch (final Exception ex) {
        handler.exception(defaultNHttpServerConnection, ex);
    }
}