ServerSocket IsClosed() Example
Returns the closed state of the ServerSocket.
ServerSocketclass IsClosed() method example. This example shows you how to use IsClosed() method.This method Returns the closed state of the ServerSocket.
Here is the code:-
/**
* @Program that Returns the closed state of the ServerSocket.
* IsClosed.java
* Author:-RoseIndia Team
* Date:-21-jun-2008
*/
import java.net.*;
public class IsClosed {
public static void main(String[] args) throws Exception{
InetAddress i = InetAddress.getByName("girish-desktop");
ServerSocket ss = new ServerSocket(8080, 1, i);
//Returns the closed state of the ServerSocket.
System.out.println("Closed state of the ServerSocket. is: " + ss.isClosed());
}
} |
Output of the program:-
| Closed state of the ServerSocket. is: false |
|