Example usage for org.apache.http.impl.nio DefaultNHttpServerConnection setSocketTimeout

List of usage examples for org.apache.http.impl.nio DefaultNHttpServerConnection setSocketTimeout

Introduction

In this page you can find the example usage for org.apache.http.impl.nio DefaultNHttpServerConnection setSocketTimeout.

Prototype

void setSocketTimeout(int i);

Source Link

Usage

From source file:org.siddhiesb.transport.http.conn.ServerConnFactory.java

public DefaultNHttpServerConnection createConnection(final IOSession iosession) {
    org.siddhiesb.transport.http.conn.SSLContextDetails customSSL = null;
    if (sslByIPMap != null) {
        customSSL = sslByIPMap.get(iosession.getLocalAddress());
    }// w  w w.ja v a2  s . c  o  m
    if (customSSL == null) {
        customSSL = ssl;
    }
    IOSession customSession;
    if (customSSL != null) {
        customSession = new SSLIOSession(iosession, SSLMode.SERVER, customSSL.getContext(),
                customSSL.getHandler());
        iosession.setAttribute(SSLIOSession.SESSION_KEY, customSession);
    } else {
        customSession = iosession;
    }
    DefaultNHttpServerConnection conn = LoggingUtils.createServerConnection(customSession, requestFactory,
            allocator, params);
    int timeout = HttpConnectionParams.getSoTimeout(params);
    conn.setSocketTimeout(timeout);
    return conn;
}