Top Description Methods
org.glassfish.grizzly

public Interface SocketBinder

Known Direct Implementers
org.glassfish.grizzly.nio.NIOTransport, org.glassfish.grizzly.AbstractBindingHandler
Imports
java.io.IOException, java.net.SocketAddress

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

Method Summary

Modifier and TypeMethod and Description
public Connection<?>

Returns:

bound Connection
bind
(int
the port to bind to
port
)

Binds Transport to the specific port on localhost.

public Connection<?>

Returns:

bound Connection
bind
(String
the local host the server will bind to
host
,
int
specific port to bind to
port
)

Binds Transport to the specific host and port.

public Connection<?>

Returns:

bound Connection
bind
(String
the local host the server will bind to
host
,
int
the port to bind to
port
,
int
the maximum length of the queue
backlog
)

Binds Transport to the specific host and port.

public Connection<?>

Returns:

bound Connection
bind
(String
the local host the server will bind to
host
,
PortRange portRange, int
the maximum length of the queue
backlog
)

Binds Transport to the specific host, and port within a PortRange.

public Connection<?>

Returns:

bound Connection
bind
(String
the local host the server will bind to
host
,
PortRange portRange, boolean
if true, a random port in the range will be used as the initial port.
randomStartPort
,
int
the maximum length of the queue
backlog
)

Binds Transport to the specific host, and port within a PortRange.

public Connection<?>

Returns:

bound Connection
bind
(SocketAddress
the local address the server will bind to
socketAddress
)

Binds Transport to the specific SocketAddress.

public Connection<?>

Returns:

bound Connection
bind
(SocketAddress
the local address the server will bind to
socketAddress
,
int
the maximum length of the queue
backlog
)

Binds Transport to the specific SocketAddress.

public Connection<?>

Returns:

bound Connection
bindToInherited
()

Binds the Transport to the channel inherited from the entity that created this Java virtual machine.

public void
unbind(Connection<?> connection)

Unbinds bound Transport connection.

public void
unbindAll()

Unbinds all bound Transport connections.

Method Detail

bindback to summary
public Connection<?> bind(int port) throws IOException

Binds Transport to the specific port on localhost.

Parameters
port:int

the port to bind to

Returns:Connection<?>

bound Connection

Exceptions
IOException:
if unable to bind i.e. if port already bound
bindback to summary
public Connection<?> bind(String host, int port) throws IOException

Binds Transport to the specific host and port.

Parameters
host:String

the local host the server will bind to

port:int

specific port to bind to

Returns:Connection<?>

bound Connection

Exceptions
IOException:
if unable to bind i.e. if port already bound
bindback to summary
public Connection<?> bind(String host, int port, int backlog) throws IOException

Binds Transport to the specific host and port.

Parameters
host:String

the local host the server will bind to

port:int

the port to bind to

backlog:int

the maximum length of the queue

Returns:Connection<?>

bound Connection

Exceptions
IOException:
if unable to bind i.e. if port already bound
bindback to summary
public Connection<?> bind(String host, PortRange portRange, int backlog) throws IOException

Binds Transport to the specific host, and port within a PortRange.

Parameters
host:String

the local host the server will bind to

portRange:PortRange

PortRange.

backlog:int

the maximum length of the queue

Returns:Connection<?>

bound Connection

Exceptions
IOException:
if unable to bind i.e. if port already bound
bindback to summary
public Connection<?> bind(String host, PortRange portRange, boolean randomStartPort, int backlog) throws IOException

Binds Transport to the specific host, and port within a PortRange.

Parameters
host:String

the local host the server will bind to

portRange:PortRange

PortRange.

randomStartPort:boolean

if true, a random port in the range will be used as the initial port.

backlog:int

the maximum length of the queue

Returns:Connection<?>

bound Connection

Exceptions
IOException:
if unable to bind i.e. if port already bound
bindback to summary
public Connection<?> bind(SocketAddress socketAddress) throws IOException

Binds Transport to the specific SocketAddress.

Parameters
socketAddress:SocketAddress

the local address the server will bind to

Returns:Connection<?>

bound Connection

Exceptions
IOException:
if unable to bind i.e. if port already bound
bindback to summary
public Connection<?> bind(SocketAddress socketAddress, int backlog) throws IOException

Binds Transport to the specific SocketAddress.

Parameters
socketAddress:SocketAddress

the local address the server will bind to

backlog:int

the maximum length of the queue

Returns:Connection<?>

bound Connection

Exceptions
IOException:
if unable to bind i.e. if port already bound
bindToInheritedback to summary
public Connection<?> bindToInherited() throws IOException

Binds the Transport to the channel inherited from the entity that created this Java virtual machine.

Returns:Connection<?>

bound Connection

Exceptions
IOException:
if unable to bind i.e. if port already bound
unbindback to summary
public void unbind(Connection<?> connection)

Unbinds bound Transport connection.

Parameters
connection:Connection<?>

Connection

unbindAllback to summary
public void unbindAll()

Unbinds all bound Transport connections.