File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 11import Proxy from './proxy'
22import Manager from './ezy-managers'
33import EzySetup from './ezy-setup'
4- import { EzyDisconnectReason } from './ezy-constants'
4+ import Const from './ezy-constants'
55import EzyLogger from './ezy-logger'
66
77class EzyClient {
@@ -32,7 +32,7 @@ class EzyClient {
3232 }
3333
3434 disconnect ( reason ) {
35- var r = reason ? reason : EzyDisconnectReason . CLOSE ;
35+ var r = reason ? reason : Const . EzyDisconnectReason . CLOSE ;
3636 Proxy . run ( "disconnect" , { clientName : this . name , reason : r } ) ;
3737 }
3838
Original file line number Diff line number Diff line change @@ -52,6 +52,11 @@ class SocketProxy {
5252 routerController . updateViews ( 'change' , 'message' ) ;
5353 } ;
5454
55+ let exitAppHandler = new Ezy . AppExitHandler ( ) ;
56+ exitAppHandler . postHandle = function ( app , data ) {
57+ this . client . close ( ) ;
58+ } ;
59+
5560 let disconnectionHandler = new Ezy . DisconnectionHandler ( ) ;
5661 disconnectionHandler . preHandle = function ( event ) {
5762 let routerController = mvc . getController ( "router" ) ;
@@ -64,6 +69,7 @@ class SocketProxy {
6469 setup . addDataHandler ( Ezy . Command . LOGIN , loginSuccessHandler ) ;
6570 setup . addDataHandler ( Ezy . Command . LOGIN_ERROR , loginErrorHandler ) ;
6671 setup . addDataHandler ( Ezy . Command . APP_ACCESS , accessAppHandler ) ;
72+ setup . addDataHandler ( Ezy . Command . APP_EXIT , exitAppHandler ) ;
6773 let setupApp = setup . setupApp ( APP_NAME ) ;
6874
6975 let messageController = mvc . getController ( "message" ) ;
You can’t perform that action at this time.
0 commit comments