Class BilibiliConnectionHandler

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.SimpleChannelInboundHandler<io.netty.handler.codec.http.FullHttpResponse>
tech.ordinaryroad.live.chat.client.servers.netty.handler.base.BaseConnectionHandler<ConnectionHandler>
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler

@Sharable public class BilibiliConnectionHandler extends BaseNettyClientConnectionHandler<BilibiliLiveChatClient,BilibiliConnectionHandler>
连接处理器
Author:
mjz
  • Nested Class Summary

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

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

    Fields inherited from class tech.ordinaryroad.live.chat.client.servers.netty.client.handler.BaseNettyClientConnectionHandler

    client
  • Constructor Summary

    Constructors
    Constructor
    Description
    BilibiliConnectionHandler(io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker handshaker, long roomId, ProtoverEnum protover)
     
    BilibiliConnectionHandler(io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker handshaker, long roomId, ProtoverEnum protover, String cookie)
     
    BilibiliConnectionHandler(io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker handshaker, long roomId, ProtoverEnum protover, tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener<BilibiliConnectionHandler> listener)
     
    BilibiliConnectionHandler(io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker handshaker, long roomId, ProtoverEnum protover, tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener<BilibiliConnectionHandler> listener, String cookie)
     
    BilibiliConnectionHandler(io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker handshaker, BilibiliLiveChatClient client)
     
    BilibiliConnectionHandler(io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker handshaker, BilibiliLiveChatClient client, tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener<BilibiliConnectionHandler> listener)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected long
     
    protected long
     
    long
     
    void
    sendAuthRequest(io.netty.channel.Channel channel)
     
    protected void
    sendHeartbeat(io.netty.channel.ChannelHandlerContext ctx)
     

    Methods inherited from class tech.ordinaryroad.live.chat.client.servers.netty.client.handler.BaseNettyClientConnectionHandler

    getClient

    Methods inherited from class tech.ordinaryroad.live.chat.client.servers.netty.handler.base.BaseConnectionHandler

    channelActive, channelRead0, exceptionCaught, getHandshakeFuture, handlerAdded, userEventTriggered

    Methods inherited from class io.netty.channel.SimpleChannelInboundHandler

    acceptInboundMessage, channelRead

    Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

    channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged

    Methods inherited from class io.netty.channel.ChannelHandlerAdapter

    ensureNotSharable, handlerRemoved, isSharable

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.netty.channel.ChannelHandler

    handlerRemoved
  • Constructor Details

    • BilibiliConnectionHandler

      public BilibiliConnectionHandler(io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker handshaker, BilibiliLiveChatClient client, tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener<BilibiliConnectionHandler> listener)
    • BilibiliConnectionHandler

      public BilibiliConnectionHandler(io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker handshaker, BilibiliLiveChatClient client)
    • BilibiliConnectionHandler

      public BilibiliConnectionHandler(io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker handshaker, long roomId, ProtoverEnum protover, tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener<BilibiliConnectionHandler> listener, String cookie)
    • BilibiliConnectionHandler

      public BilibiliConnectionHandler(io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker handshaker, long roomId, ProtoverEnum protover, tech.ordinaryroad.live.chat.client.commons.base.listener.IBaseConnectionListener<BilibiliConnectionHandler> listener)
    • BilibiliConnectionHandler

      public BilibiliConnectionHandler(io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker handshaker, long roomId, ProtoverEnum protover, String cookie)
    • BilibiliConnectionHandler

      public BilibiliConnectionHandler(io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker handshaker, long roomId, ProtoverEnum protover)
  • Method Details

    • sendHeartbeat

      protected void sendHeartbeat(io.netty.channel.ChannelHandlerContext ctx)
      Specified by:
      sendHeartbeat in class tech.ordinaryroad.live.chat.client.servers.netty.handler.base.BaseConnectionHandler<BilibiliConnectionHandler>
    • sendAuthRequest

      public void sendAuthRequest(io.netty.channel.Channel channel)
      Specified by:
      sendAuthRequest in class tech.ordinaryroad.live.chat.client.servers.netty.handler.base.BaseConnectionHandler<BilibiliConnectionHandler>
    • getRoomId

      public long getRoomId()
    • getHeartbeatPeriod

      protected long getHeartbeatPeriod()
      Specified by:
      getHeartbeatPeriod in class tech.ordinaryroad.live.chat.client.servers.netty.handler.base.BaseConnectionHandler<BilibiliConnectionHandler>
    • getHeartbeatInitialDelay

      protected long getHeartbeatInitialDelay()
      Specified by:
      getHeartbeatInitialDelay in class tech.ordinaryroad.live.chat.client.servers.netty.handler.base.BaseConnectionHandler<BilibiliConnectionHandler>