socket.connect({ port: tcpOptions.port, host: tcpOptions.host }, () => { socket.setEncoding(tcpOptions.encoding); socket.setTimeout(tcpOptions.timeout); socket.setNoDelay(tcpOptions.noDelay); socket.setKeepAlive(tcpOptions.keepAlive, tcpOptions.initialDelay);