net_socket.setTimeout()

socket.setTimeout(timeout[, callback])

Sets the socket to timeout after timeout milliseconds of inactivity on the socket. By default net.Socket do not have a timeout.

When an idle timeout is triggered the socket will receive a 'timeout' event but the connection will not be severed. The user must manually end() or destroy() the socket.

If timeout is 0, then the existing idle timeout is disabled.

The optional callback parameter will be added as a one time listener for the 'timeout' event.

Returns socket.

doc_Nodejs
2016-04-30 04:40:37
Comments
Leave a Comment

Please login to continue.