Skip to content

Commit

Permalink
use self ref in end() and destroy()
Browse files Browse the repository at this point in the history
Signed-off-by: Mario Kozjak <kozjakm1@gmail.com>
  • Loading branch information
mkozjak committed Nov 22, 2015
1 parent 8c27ddc commit 0688cad
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/telnet-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,19 @@ Telnet.prototype.exec = function(cmd, opts, callback) {
}

Telnet.prototype.end = function() {
var self = this

return new Promise(function(resolve) {
this.telnetSocket.end()
self.telnetSocket.end()
resolve()
})
}

Telnet.prototype.destroy = function() {
var self = this

return new Promise(function(resolve) {
this.telnetSocket.destroy()
self.telnetSocket.destroy()
resolve()
})
}
Expand Down

0 comments on commit 0688cad

Please sign in to comment.