Class MqttServerInitializer

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel>
com.bytedesk.core.socket.mqtt.initializer.MqttServerInitializer
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler

public class MqttServerInitializer extends io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel>
Author:
bytedesk.com on 2019-07-05
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

    io.netty.channel.ChannelHandler.Sharable
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
     
    private final ProtocolProcess
     
    private final io.netty.handler.ssl.SslContext
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    initChannel(io.netty.channel.socket.SocketChannel socketChannel)
    TODO: ChannelInitializer中应该使用 NioSocketChannel or SocketChannel ?

    Methods inherited from class io.netty.channel.ChannelInitializer

    channelRegistered, exceptionCaught, handlerAdded, handlerRemoved

    Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

    channelActive, channelInactive, channelRead, channelReadComplete, channelUnregistered, channelWritabilityChanged, userEventTriggered

    Methods inherited from class io.netty.channel.ChannelHandlerAdapter

    ensureNotSharable, isSharable

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • mSslCtx

      private final io.netty.handler.ssl.SslContext mSslCtx
    • mProtocolProcess

      private final ProtocolProcess mProtocolProcess
    • mMaxPayloadSize

      private final int mMaxPayloadSize
  • Constructor Details

    • MqttServerInitializer

      public MqttServerInitializer()
  • Method Details

    • initChannel

      protected void initChannel(io.netty.channel.socket.SocketChannel socketChannel) throws Exception
      TODO: ChannelInitializer中应该使用 NioSocketChannel or SocketChannel ?优缺点?
      Specified by:
      initChannel in class io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel>
      Parameters:
      socketChannel - channel
      Throws:
      Exception - expt