Socket.nodelay readwrite property



The Socket.nodelay property get/set the TCP_NODELAY option on the socket, to control Nagle algorithm.

  • When set to false Nagle algorithm is enabled, TCP will wait to send small amounts of data until the acknowledgment for the previous data is received.
  • When set to true Nagle algorithm is disabled (the default), TCP will send small amounts of data even before the acknowledgment for previous data sent is received.

Example

local net = require "net" -- create and connect a client TCP socket to the host "google.com" local socket = net.Socket("google.com", 80) -- outputs false (the default Socket.nodelay value) print("TCP_NODELAY = "..tostring(socket.nodelay))