diff --git a/src/main/java/io/vertx/core/impl/transports/EpollTransport.java b/src/main/java/io/vertx/core/impl/transports/EpollTransport.java index 8d32e24d264..9c3cb8b1e72 100644 --- a/src/main/java/io/vertx/core/impl/transports/EpollTransport.java +++ b/src/main/java/io/vertx/core/impl/transports/EpollTransport.java @@ -169,6 +169,16 @@ public void configure(ClientOptionsBase options, boolean domainSocket, Bootstrap bootstrap.option(EpollChannelOption.TCP_USER_TIMEOUT, options.getTcpUserTimeout()); bootstrap.option(EpollChannelOption.TCP_QUICKACK, options.isTcpQuickAck()); bootstrap.option(EpollChannelOption.TCP_CORK, options.isTcpCork()); + + if (options.isTcpKeepAlive() && options.getTcpKeepAliveIdleSeconds() != -1) { + bootstrap.option(EpollChannelOption.TCP_KEEPIDLE, options.getTcpKeepAliveIdleSeconds()); + } + if (options.isTcpKeepAlive() && options.getTcpKeepAliveCount() != -1) { + bootstrap.option(EpollChannelOption.TCP_KEEPCNT, options.getTcpKeepAliveCount()); + } + if (options.isTcpKeepAlive() && options.getTcpKeepAliveIntervalSeconds() != -1) { + bootstrap.option(EpollChannelOption.TCP_KEEPINTVL, options.getTcpKeepAliveIntervalSeconds()); + } } Transport.super.configure(options, domainSocket, bootstrap); }