@@ -29,7 +29,7 @@ function Client(conn, server) {
29
29
* @api private
30
30
*/
31
31
Client . prototype . _setup = function ( ) {
32
- var that = this , logger = this . logger , client = that . connection ;
32
+ var that = this , client = that . connection ;
33
33
34
34
this . _buildForward ( ) ;
35
35
@@ -42,7 +42,7 @@ Client.prototype._setup = function() {
42
42
} ) ;
43
43
44
44
client . on ( "pingreq" , function ( ) {
45
- logger . debug ( "pingreq" ) ;
45
+ that . logger . debug ( "pingreq" ) ;
46
46
that . setUpTimer ( ) ;
47
47
that . connection . pingresp ( ) ;
48
48
} ) ;
@@ -59,10 +59,10 @@ Client.prototype._setup = function() {
59
59
} ) ;
60
60
61
61
client . on ( "unsubscribe" , function ( packet ) {
62
- logger . info ( { packet : packet } , "unsubscribe received" ) ;
62
+ that . logger . info ( { packet : packet } , "unsubscribe received" ) ;
63
63
async . parallel ( packet . unsubscriptions . map ( that . unsubscribeMapTo . bind ( that ) ) , function ( err ) {
64
64
if ( err ) {
65
- logger . warn ( err ) ;
65
+ that . logger . warn ( err ) ;
66
66
that . unsubAndClose ( ) ;
67
67
return ;
68
68
}
@@ -73,17 +73,17 @@ Client.prototype._setup = function() {
73
73
} ) ;
74
74
75
75
client . on ( "disconnect" , function ( ) {
76
- logger . debug ( "disconnect requested" ) ;
76
+ that . logger . debug ( "disconnect requested" ) ;
77
77
that . unsubAndClose ( ) ;
78
78
} ) ;
79
79
80
80
client . on ( "error" , function ( err ) {
81
- logger . warn ( err ) ;
81
+ that . logger . warn ( err ) ;
82
82
that . unsubAndClose ( ) ;
83
83
} ) ;
84
84
85
85
client . on ( "close" , function ( ) {
86
- logger . info ( "disconnected" ) ;
86
+ that . logger . info ( "disconnected" ) ;
87
87
that . _closed = true ;
88
88
that . onClose ( ) ;
89
89
} ) ;
0 commit comments