Created
November 11, 2015 06:13
-
-
Save identityclash/bd8ef53e7f0f82a32df5 to your computer and use it in GitHub Desktop.
nssocket memory leak
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nssocket = require('nssocket'); | |
var client = new nssocket.NsSocket(); | |
client.on('start', function () { | |
console.log('connected'); | |
}); | |
client.on('close', function () { | |
console.log('disconnected'); | |
}); | |
client.on('error', function(err) { | |
console.log(err); | |
}); | |
client.connect(8080); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nssocket = require('nssocket'); | |
var server = nssocket.createServer(function (socket) { | |
socket.on('close', function () { | |
console.log('disconnected'); | |
socket.destroy(); | |
}); | |
socket.on('error', function (err) { | |
console.log(err); | |
socket.destroy(); | |
}); | |
}); | |
server.listen(8080); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment