Example usage for io.netty.channel ChannelConfig setConnectTimeoutMillis

List of usage examples for io.netty.channel ChannelConfig setConnectTimeoutMillis

Introduction

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

Prototype

ChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis);

Source Link

Document

Sets the connect timeout of the channel in milliseconds.

Usage

From source file:io.jenkins.docker.client.NettyDockerCmdExecFactory.java

License:Apache License

private <T extends Channel> T configure(T channel) {
    ChannelConfig channelConfig = channel.config();

    if (connectTimeout != null) {
        channelConfig.setConnectTimeoutMillis(connectTimeout);
    }//from  w ww.j  a v  a  2 s .c o  m
    // START of new readTimeout code
    if (readTimeout != null) {
        channel.pipeline().addLast("readTimeoutHandler", new ReadTimeoutHandler());
    }
    // END of new readTimeout code

    return channel;
}