Ende.TcpConn

interface

interface Ende.TcpConn extends Conn<NetAddr>

A TCP stream connection.

Methods

setNoDelay

setNoDelay(noDelay?: boolean): void

Sets the TCP_NODELAY option on this connection, which controls whether Nagle's algorithm is used.

Note that the boolean is noDelay, not "enable Nagle", so the sense is the opposite of enabling the algorithm:

  • setNoDelay(true) (the default) sets TCP_NODELAY, which disables Nagle's algorithm. Small writes are sent immediately with lower latency, at the cost of potentially more, smaller packets.
  • setNoDelay(false) clears TCP_NODELAY, which enables Nagle's algorithm. Small writes may be buffered and coalesced to reduce the number of packets sent.
noDelay?: boolean

When true, disables Nagle's algorithm.

setKeepAlive

setKeepAlive(keepAlive?: boolean): void

Enable or disable TCP keep-alive probes on this connection. Pass true to enable keep-alive and false to disable it.