Online Java Compiler By
JavaTpoint.com
import java.io.IOException; import java.net.*; public class JavaSocketGetTcpNoDelayExample2 { public static void main(String[] args) throws IOException { //calling the constructor of the socket class Socket socket = new Socket(); //getTcpNoDelay() returns the setting for SO_TIMEOUT option //the default set for getTcpNoDelay() option is false System.out.println("SO_TIMEOUT option is enabled: "+socket.getTcpNoDelay()); } }
Output