export class DefaultNetEventHandler implements enet . INetEventHandler { onStartConnenct ? ( connectOpt ) { console . log ( `start connect:${ connectOpt . url },opt:` , connectOpt ) ; } onConnectEnd ? ( connectOpt , handshakeRes ? ) { console . log ( `connect ok:${ connectOpt . url },opt:` , connectOpt ) ; console . log ( `handshakeRes:` , handshakeRes ) ; } onError ( event , connectOpt ) { console . error ( `socket error,opt:` , connectOpt ) ; console . error ( event ) ; } onClosed ( event , connectOpt ) { console . error ( `socket close,opt:` , connectOpt ) ; console . error ( event ) ; } onStartReconnect ? ( reConnectCfg , connectOpt ) { console . log ( `start reconnect:${ connectOpt . url },opt:` , connectOpt ) ; } onReconnecting ? ( curCount , reConnectCfg , connectOpt ) { console . log ( `url:${ connectOpt . url } reconnect count:${ curCount },less count:${ reConnectCfg . reconnectCount },opt:` , connectOpt ) ; } onReconnectEnd ? ( isOk , reConnectCfg , connectOpt ) { console . log ( `url:${ connectOpt . url }reconnect end ${ isOk ? "ok" : "fail" } ,opt:` , connectOpt ) ; } onStartRequest ? ( reqCfg , connectOpt ) { console . log ( `start request:${ reqCfg . protoKey },id:${ reqCfg . reqId },opt:` , connectOpt ) ; console . log ( `reqCfg:` , reqCfg ) ; } onData ? ( dpkg , connectOpt ) { console . log ( `data :${ dpkg . key },opt:` , connectOpt ) ; } onRequestTimeout ? ( reqCfg , connectOpt ) { console . warn ( `request timeout:${ reqCfg . protoKey },opt:` , connectOpt ) ; } onCustomError ? ( dpkg , connectOpt ) { console . error ( `proto key:${ dpkg . key },reqId:${ dpkg . reqId },code:${ dpkg . code },errorMsg:${ dpkg . errorMsg },opt:` , connectOpt ) ; } onKick ( dpkg , copt ) { console . log ( `be kick,opt:` , copt ) ; } }