node.js - How to disconect listen port ( http ) in Nodejs -
for example, tunnel, , want shut down 10 minutes , after timeout listen in on again. socket has packet node-webkit. i've tried several times still failed , error.
var server = http.createserver( r, q ){ //some code }).listen(8080); server.on( 'error', function(){ /* handle */ }); server.on( 'close', function(){ /* handle */ });
how totally stop listener port without having shut down node-webkit ?
according api docs, listener closed when close
event emitted, there no need close manually. presumably listener closed when error
event emitted; however, don't see event documented anywhere.
see server.close(...)
(with optional callback) method reference.
Comments
Post a Comment