DatagramSocket IsBound() Example

Returns the binding state of the socket.


DatagramSocketclass IsBound() method example. This example shows you how to use IsBound() method.This method Returns the binding state of the socket.

Here is the code:-

/**
 * @Program that Returns the binding state of the socket.
 * IsBound.java 
 * Author:-RoseIndia Team
 * Date:-20-jun-2008
 */
import java.net.*;

public class IsBound {

    public static void main(String[] argsthrows Exception {
        DatagramSocket ds = new DatagramSocket();
        ds.connect(new InetSocketAddress(9090));
        System.out.println("The binding state of the socket is: " + ds.isBound());
    }
}

Output of the program:-
 The binding state of the socket is: true

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

HOME | COPYRIGHT | CONTACT US