Online Java Compiler By
JavaTpoint.com
import java.io.IOException; import java.net.*; public class JavaSocketShutDownInputExample3 { public static void main(String[] args) throws IOException { //calling the constructor of the socket class Socket socket = new Socket(); //the socket should be connected //shutting down the input socket.shutdownInput(); //isInputShutdown() returns a Boolean value indicating if the read-half of the socket connection is closed. System.out.println("Input is shutdown: "+socket.isInputShutdown()); } }
Output