use of net.glowstone.net.handler.legacyping.LegacyPingHandler in project Glowstone by GlowstoneMC.
the class GlowChannelInitializer method initChannel.
@Override
protected void initChannel(SocketChannel c) {
MessageHandler handler = new MessageHandler(connectionManager);
CodecsHandler codecs = new CodecsHandler(ProtocolType.HANDSHAKE.getProtocol());
FramingHandler framing = new FramingHandler();
try {
c.config().setOption(ChannelOption.IP_TOS, 0x18);
} catch (ChannelException e) {
// Not supported on all OSs, like Windows XP and lesser
GlowServer.logger.warning("Your OS does not support type of service.");
}
c.config().setAllocator(PooledByteBufAllocator.DEFAULT);
c.pipeline().addLast("idle_timeout", new IdleStateHandler(READ_IDLE_TIMEOUT, WRITE_IDLE_TIMEOUT, 0)).addLast("legacy_ping", new LegacyPingHandler(connectionManager)).addLast("encryption", NoopHandler.INSTANCE).addLast("framing", framing).addLast("compression", NoopHandler.INSTANCE).addLast("codecs", codecs).addLast("handler", handler);
}
Aggregations