|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.nio.conman.ServerSocketChannelAcceptor
public class ServerSocketChannelAcceptor
Binds sockets on a given hostname for a set of ports for tcp connections, and passes accepted connections into a connection manager.
| Field Summary | |
|---|---|
protected String |
_bindHostname
|
protected ConnectionManager |
_conMan
|
protected int[] |
_ports
|
protected List<ServerSocketChannel> |
_ssockets
|
| Constructor Summary | |
|---|---|
ServerSocketChannelAcceptor(String socketHostname,
int[] socketPorts,
ConnectionManager mgr)
Configures the connection manager with the hostname and ports on which it will listen for socket connections. |
|
| Method Summary | |
|---|---|
protected void |
acceptConnections(int port)
|
boolean |
bind()
Bind to the socket ports and return true if any of the binds succeeded. |
protected void |
configureSocket(ServerSocketChannel ssocket)
Override to perform any desired additional socket configuration before binding. |
void |
shutdown()
Unbind our listening sockets. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final int[] _ports
protected final String _bindHostname
protected final ConnectionManager _conMan
protected List<ServerSocketChannel> _ssockets
| Constructor Detail |
|---|
public ServerSocketChannelAcceptor(String socketHostname,
int[] socketPorts,
ConnectionManager mgr)
socketHostname - the hostname to which we bind our sockets or null to bind to all
interfaces.socketPorts - the ports on which to listen for TCP connection.| Method Detail |
|---|
public boolean bind()
public void shutdown()
shutdown in interface Lifecycle.ShutdownComponent
protected void acceptConnections(int port)
throws IOException
IOException
protected void configureSocket(ServerSocketChannel ssocket)
throws IOException
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||