What does the java.net.Socket.setTcpNoDelay method do, and what is Nagles algorithm?
This method controls the socket option TCP_NODELAY, which allows applications to enable or disable Nagle’s algorithm. Nagle’s algorithm (described in RFC 896), conserves bandwidth by minimizing the number of segments that are sent. When applications wish to decrease network latency and increase performance, they can disable Nagle’s algorithm. Data will be sent earlier, at the cost of an increase in bandwidth consumption.