Socket isBound Example

Started by VelMurugan, Jan 07, 2009, 11:49 PM

Previous topic - Next topic

VelMurugan

Socket isBound Example

Socket class isBound example. This example shows you how to use isBound method.

Socket class isBound example. public boolean isBound() Returns the binding state of the socket.

Here is the code


/*
* @ # IsBound.java
* A class repersenting use to IsBound method
* of NumberFormat class in java.text package
* version 17 June 2008
* author Rose India
*/

import java.net.*;

public class IsBound {

    public static void main(String args[]) throws Exception {

        Socket socket = new Socket();

        //Connects this socket to the server.
        socket.connect(new InetSocketAddress("192.168.10.211", 8080));

        System.out.println("Binding state of the socket " + socket.isBound());

        //close socket
        socket.close();
    }
}


Output

Binding state of the socket true

Source : codingdiary