Socket Options in Java
Often, it is necessary to change basic features in Sockets. Berkeley-derived sockets allow one to set various standard options
Some options are available only for ServerSockets (explained later).
Standard socket options available in Java include:
-- The “Socket Option Linger”; for when a close call catches material still in the send buffer
-- The “Socket Option Timeout”; determines how long a connection may be idle before timeout.
-- The so-called “Nagle’s Algorithm” option; useful for WAN-based applications where small packets are likely (rlogin, ssh, telnet, etc.), and limited window sizes will lead to delay.