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[] argsthrows Exception{
         InetAddress i = InetAddress.getByName("girish-desktop");
        ServerSocket ss = new ServerSocket(80801, 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

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US