What socket options are supported in Java?

Tim Rohaly

Java supports only a subset of options normally provided for BSD sockets. These are:

SO_LINGERlinger if data is present when socket is closed
SO_RCVTIMEOreceive timeout (Java calls this SO_TIMEOUT)
SO_SNDBUFsend buffer size
SO_RCVBUFreceive buffer size
TCP_NODELAYdon't wait for additional data before sending small packets
SO_KEEPALIVE(JDK 1.3+ only) periodically poll over the socket at the protocol level to keep it connected