Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClientBootstrap and ServerBootstrap should accept socket options #85

Open
enis opened this issue Feb 13, 2017 · 3 comments
Open

ClientBootstrap and ServerBootstrap should accept socket options #85

enis opened this issue Feb 13, 2017 · 3 comments

Comments

@enis
Copy link

enis commented Feb 13, 2017

One can configure socket level options (TCP_NODELAY, etc) in Netty's Bootstrap like this:

    this.channel = new Bootstrap().group(rpcClient.group).channel(rpcClient.channelClass)
        .option(ChannelOption.TCP_NODELAY, rpcClient.isTcpNoDelay())
        .option(ChannelOption.SO_KEEPALIVE, rpcClient.tcpKeepAlive)
        .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, rpcClient.connectTO)

At least in ServerBootstrap there is a configurable ServerSockerFactory which can be used to configure the socket. In ClientBootstrap, I could not find an easy way to do that.

We need this for the HBase-native-client, happening here: https://issues.apache.org/jira/browse/HBASE-14850

@ChingweiYu
Copy link

ChingweiYu commented Feb 14, 2017 via email

@anirudhvr
Copy link
Contributor

@enis Yeah looks like there's no easy way yet. Probably cleanest would be to abstract out the common SocketConfig methods and create a separate ClientSocketConfig and ServerSocketConfig, and to modify ClientBootstrap to use a socket factory. cc @djwatson

@djwatson
Copy link

Yea pretty much. Now accepting diffs :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants