org.glassfish.grizzly
Interface SocketBinder

All Known Implementing Classes:
TCPNIOTransport, UDPNIOTransport

public interface SocketBinder

Common API for Socket based Transports, which are able to bind server Socket to specific address and listen for incoming data.

Author:
Alexey Stashok

Method Summary
 Connection bind(int port)
          Binds Transport to the specific port on localhost.
 Connection bind(java.net.SocketAddress socketAddress)
          Binds Transport to the specific SocketAddress.
 Connection bind(java.net.SocketAddress socketAddress, int backlog)
          Binds Transport to the specific SocketAddress.
 Connection bind(java.lang.String host, int port)
          Binds Transport to the specific host and port.
 Connection bind(java.lang.String host, int port, int backlog)
          Binds Transport to the specific host and port.
 Connection bind(java.lang.String host, PortRange portRange, int backlog)
          Binds Transport to the specific host, and port within a PortRange.
 void unbind(Connection connection)
          Unbinds bound Transport connection.
 void unbindAll()
          Unbinds all bound Transport connections.
 

Method Detail

bind

Connection bind(int port)
                throws java.io.IOException
Binds Transport to the specific port on localhost.

Parameters:
port -
Returns:
bound Connection
Throws:
java.io.IOException

bind

Connection bind(java.lang.String host,
                int port)
                throws java.io.IOException
Binds Transport to the specific host and port.

Parameters:
host - the local host the server will bind to
port -
Returns:
bound Connection
Throws:
java.io.IOException

bind

Connection bind(java.lang.String host,
                int port,
                int backlog)
                throws java.io.IOException
Binds Transport to the specific host and port.

Parameters:
host - the local host the server will bind to
port -
backlog - the maximum length of the queue
Returns:
bound Connection
Throws:
java.io.IOException

bind

Connection bind(java.lang.String host,
                PortRange portRange,
                int backlog)
                throws java.io.IOException
Binds Transport to the specific host, and port within a PortRange.

Parameters:
host - the local host the server will bind to
portRange - PortRange.
backlog - the maximum length of the queue
Returns:
bound Connection
Throws:
java.io.IOException

bind

Connection bind(java.net.SocketAddress socketAddress)
                throws java.io.IOException
Binds Transport to the specific SocketAddress.

Parameters:
socketAddress - the local address the server will bind to
Returns:
bound Connection
Throws:
java.io.IOException

bind

Connection bind(java.net.SocketAddress socketAddress,
                int backlog)
                throws java.io.IOException
Binds Transport to the specific SocketAddress.

Parameters:
socketAddress - the local address the server will bind to
backlog - the maximum length of the queue
Returns:
bound Connection
Throws:
java.io.IOException

unbind

void unbind(Connection connection)
            throws java.io.IOException
Unbinds bound Transport connection.

Parameters:
connection - Connection
Throws:
java.io.IOException

unbindAll

void unbindAll()
               throws java.io.IOException
Unbinds all bound Transport connections.

Throws:
java.io.IOException


Copyright © 2011 Oracle Corpration. All Rights Reserved.