List of usage examples for io.vertx.core.net NetServerOptions setTcpNoDelay
@Override public NetServerOptions setTcpNoDelay(boolean tcpNoDelay)
From source file:com.sibvisions.vertx.NetSocketServer.java
License:Apache License
/** * Starts the server to listen on the configured port. *///from ww w . j a v a 2s.c o m public void start() { if (vertx == null) { vertx = Vertx.vertx(); } NetServerOptions options = new NetServerOptions(); options.setTcpKeepAlive(true); options.setTcpNoDelay(true); srvVertx = vertx.createNetServer(options); srvVertx.connectHandler(new Handler<NetSocket>() { public void handle(NetSocket pSocket) { AbstractDataHandler dataHandler = new NetDataHandler(srvJVx, pSocket); pSocket.handler(dataHandler); pSocket.endHandler(new StopHandler(dataHandler)); pSocket.exceptionHandler(new ExceptionHandler(dataHandler)); } }); srvVertx.listen(iPort, sInterface); }