Java Socket shutdownOutput() methodThe shutdownOutput() method of Java Socket class disables the output stream for the specified socket. If the socket output stream is written after invoking the shutdownOutput() method on the socket, the stream will throw an IOException. SyntaxParameterNA ReturnNA ThrowsIOException - if an I/O error occurs while shutting down the given socket Example 1Test it NowOutput: The socket is connected: true The socket is bounded: true The socket is shutdown: true Example 2Test it NowOutput: Exception in thread "main" java.net.SocketException: Socket is not connected at java.net.Socket.shutdownOutput(Socket.java:1553) at com.javaTpoint.JavaSocketShutdownOutputExample2.main(JavaSocketShutdownOutputExample2.java:10) Next TopicJava Socket Class |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India