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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -