Example usage for io.netty.channel.socket SocketChannelConfig setConnectTimeoutMillis

List of usage examples for io.netty.channel.socket SocketChannelConfig setConnectTimeoutMillis

Introduction

In this page you can find the example usage for io.netty.channel.socket SocketChannelConfig setConnectTimeoutMillis.

Prototype

@Override
    SocketChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis);

Source Link

Usage

From source file:com.codeabovelab.dm.platform.http.async.NettyRequestFactory.java

License:Apache License

/**
 * Template method for changing properties on the given {@link SocketChannelConfig}.
 * <p>The default implementation sets the connect timeout based on the set property.
 * @param config the channel configuration
 *///from w  w  w .j a v  a 2  s.com
protected void configureChannel(SocketChannelConfig config) {
    if (this.connectTimeout >= 0) {
        config.setConnectTimeoutMillis(this.connectTimeout);
    }
}