perf: optimize websocket logic

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2020-11-20 14:21:57 +08:00
parent cd57944cb8
commit 894d5d43e6
12 changed files with 273 additions and 228 deletions

View File

@@ -12,8 +12,12 @@ export abstract class WebSocketHandlerAdapter {
this._Handler = new ChannelInboundHandlerAdapterImpl()
}
abstract channelRead(ctx: any, channel: any)
abstract channelInactive(ctx: any)
abstract channelUnregistered(ctx: any)
channelInactive(ctx: any) {
ctx.fireChannelInactive()
}
channelUnregistered(ctx: any) {
ctx.fireChannelUnregistered()
}
abstract exceptionCaught(ctx: any, cause: Error)
getHandler() {
return this._Handler