Java Code Examples for java.net.Socket.isBound()

The following are Jave code examples for showing how to use isBound() of the java.net.Socket class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: blackbird   File: NetworkConnection.java   View Source Code Vote up 5 votes
/**
 * Creates a connection using a connected socket
 *
 * @param socket the socket this connection is based on
 * @throws IOException if the socket is either closed, unbound or not connected.
 */
public NetworkConnection(Socket socket) throws IOException {
    if (socket.isClosed() || !socket.isBound() || !socket.isConnected())
        throw new IOException("NetworkConnection expects a not closed, bound and connected socket");

    this.socket = socket;
}