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>
tech.ordinaryroad.live.chat.client.servers.netty.client.handler.BaseNettyClientConnectionHandler<BilibiliLiveChatClient,BilibiliConnectionHandler>
tech.ordinaryroad.live.chat.client.bilibili.netty.handler.BilibiliConnectionHandler
- 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
ConstructorsConstructorDescriptionBilibiliConnectionHandler(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 TypeMethodDescriptionprotected longprotected longlongvoidsendAuthRequest(io.netty.channel.Channel channel) protected voidsendHeartbeat(io.netty.channel.ChannelHandlerContext ctx) Methods inherited from class tech.ordinaryroad.live.chat.client.servers.netty.client.handler.BaseNettyClientConnectionHandler
getClientMethods inherited from class tech.ordinaryroad.live.chat.client.servers.netty.handler.base.BaseConnectionHandler
channelActive, channelRead0, exceptionCaught, getHandshakeFuture, handlerAdded, userEventTriggeredMethods inherited from class io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelReadMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChangedMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
sendHeartbeatin classtech.ordinaryroad.live.chat.client.servers.netty.handler.base.BaseConnectionHandler<BilibiliConnectionHandler>
-
sendAuthRequest
public void sendAuthRequest(io.netty.channel.Channel channel) - Specified by:
sendAuthRequestin classtech.ordinaryroad.live.chat.client.servers.netty.handler.base.BaseConnectionHandler<BilibiliConnectionHandler>
-
getRoomId
public long getRoomId() -
getHeartbeatPeriod
protected long getHeartbeatPeriod()- Specified by:
getHeartbeatPeriodin classtech.ordinaryroad.live.chat.client.servers.netty.handler.base.BaseConnectionHandler<BilibiliConnectionHandler>
-
getHeartbeatInitialDelay
protected long getHeartbeatInitialDelay()- Specified by:
getHeartbeatInitialDelayin classtech.ordinaryroad.live.chat.client.servers.netty.handler.base.BaseConnectionHandler<BilibiliConnectionHandler>
-