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

@@ -11,16 +11,6 @@ export class WebSocketDetect extends WebSocketHandlerAdapter {
channelRead(ctx: any, channel: any) {
this.event.emit(ServerEvent.detect, ctx, channel)
}
channelInactive(ctx: any) {
console.debug('WebSocketDetect channelUnregistered ' + ctx)
this.event.emit(ServerEvent.disconnect, ctx, 'client disconnect')
ctx.channelInactive()
}
channelUnregistered(ctx: any) {
console.debug('WebSocketDetect channelUnregistered ' + ctx)
this.event.emit(ServerEvent.disconnect, ctx, 'client disconnect')
ctx.fireChannelUnregistered()
}
exceptionCaught(ctx: any, cause: Error) {
this.event.emit(ServerEvent.error, ctx, cause)
}