This commit is contained in:
Redkale
2018-04-28 21:36:46 +08:00
parent 18459b71c2
commit db99445878
2 changed files with 8 additions and 9 deletions

View File

@@ -225,10 +225,13 @@ public abstract class Server<K extends Serializable, C extends Context, R extend
this.context = this.createContext();
this.prepare.init(this.context, config);
this.serverChannel = ProtocolServer.create(this.protocol, context);
this.serverChannel.open();
this.serverChannel.open(config);
if (this.serverChannel.supportedOptions().contains(StandardSocketOptions.TCP_NODELAY)) {
this.serverChannel.setOption(StandardSocketOptions.TCP_NODELAY, true);
}
if (this.serverChannel.supportedOptions().contains(StandardSocketOptions.SO_KEEPALIVE)) {
this.serverChannel.setOption(StandardSocketOptions.SO_KEEPALIVE, true);
}
serverChannel.bind(address, backlog);
serverChannel.setMaxconns(this.maxconns);
serverChannel.accept();