socket.remotePort The numeric representation of the remote port. For example, 80 or 21.
socket.setKeepAlive([enable][, initialDelay]) Enable/disable keep-alive functionality, and optionally set the initial delay before the first keepalive probe is sent on an idle socket. enable defaults to false. Set initialDelay (in milliseconds) to set the delay between the last data packet received and the first keepalive probe. Setting 0 for initialDelay will leave the value unchanged from the default (or previous) setting. Defaults to 0. Returns socket.
socket.setEncoding([encoding]) Set the encoding for the socket as a Readable Stream. See stream.setEncoding() for more information.
socket.setNoDelay([noDelay]) Disables the Nagle algorithm. By default TCP connections use the Nagle algorithm, they buffer data before sending it off. Setting true for noDelay will immediately fire off data each time socket.write() is called. noDelay defaults to true. Returns socket.
socket.localPort The numeric representation of the local port. For example, 80 or 21.
socket.ref() Opposite of unref, calling ref on a previously unrefd socket will not let the program exit if it's the only socket left (the default behavior). If the socket is refd calling ref again will have no effect. Returns socket.
socket.remoteFamily The string representation of the remote IP family. 'IPv4' or 'IPv6'.
socket.pause() Pauses the reading of data. That is, 'data' events will not be emitted. Useful to throttle back an upload.
socket.remoteAddress The string representation of the remote IP address. For example, '74.125.127.100' or '2001:4860:a005::68'. Value may be undefined if the socket is destroyed (for example, if the client disconnected).
socket.end([data][, encoding]) Half-closes the socket. i.e., it sends a FIN packet. It is possible the server will still send some data. If data is specified, it is equivalent to calling socket.write(data, encoding) followed by socket.end().
Page 34 of 81