@ -1,6 +1,6 @@
|
||||
import { EventEmitter } from 'events'
|
||||
import { SocketIO } from 'socket-io/interfaces';
|
||||
import { Keys, AttributeKeys } from './constants';
|
||||
import { AttributeKeys } from './constants';
|
||||
|
||||
const TextWebSocketFrame = Java.type('io.netty.handler.codec.http.websocketx.TextWebSocketFrame')
|
||||
|
||||
|
@ -4,7 +4,7 @@ import { ServerEvent, Keys } from './constants'
|
||||
import { WebSocketDetect } from './websocket_detect'
|
||||
import { WebSocketHandler } from './websocket_handler'
|
||||
import { NettyClient } from './client'
|
||||
import { ServerOptions, Server } from '../socket-io'
|
||||
import { ServerOptions } from '../socket-io'
|
||||
|
||||
class NettyWebSocketServer extends EventEmitter {
|
||||
private pipeline: any;
|
||||
|
@ -11,4 +11,7 @@ export class WebSocketDetect extends WebSocketHandlerAdapter {
|
||||
channelRead(ctx: any, channel: any) {
|
||||
this.event.emit(ServerEvent.detect, ctx, channel);
|
||||
}
|
||||
exceptionCaught(ctx: any, cause: Error) {
|
||||
this.event.emit(ServerEvent.error, ctx, cause);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { EventEmitter } from 'events'
|
||||
|
||||
import { Keys } from './constants'
|
||||
import { Keys, ServerEvent } from './constants'
|
||||
import { WebSocketHandlerAdapter } from "../netty"
|
||||
import { HttpRequestHandler } from './httprequest'
|
||||
import { TextWebSocketFrameHandler } from './text_websocket_frame'
|
||||
@ -40,4 +40,7 @@ export class WebSocketHandler extends WebSocketHandlerAdapter {
|
||||
msg.resetReaderIndex()
|
||||
ctx.fireChannelRead(msg)
|
||||
}
|
||||
exceptionCaught(ctx: any, cause: Error) {
|
||||
this.options.event.emit(ServerEvent.error, ctx, cause)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user