|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.mina.common.support.BaseIoService
org.apache.mina.common.support.BaseIoAcceptor
org.apache.mina.transport.socket.nio.SocketAcceptor
public class SocketAcceptor
IoAcceptor for socket transport (TCP/IP).
| Constructor Summary | |
|---|---|
SocketAcceptor()
Create an acceptor with a single processing thread using a NewThreadExecutor |
|
SocketAcceptor(int processorCount,
Executor executor)
Create an acceptor with the desired number of processing threads |
|
| Method Summary | |
|---|---|
void |
bind(SocketAddress address,
IoHandler handler,
IoServiceConfig config)
Binds to the specified address and handles incoming connections with the specified
handler. |
SocketAcceptorConfig |
getDefaultConfig()
Returns the default configuration which is used when you didn't specify any configuration. |
void |
setDefaultConfig(SocketAcceptorConfig defaultConfig)
Sets the config this acceptor will use by default. |
void |
unbind(SocketAddress address)
Unbinds from the specified address and disconnects all clients
connected there. |
void |
unbindAll()
Unbinds all addresses which were bound by this acceptor. |
| Methods inherited from class org.apache.mina.common.support.BaseIoAcceptor |
|---|
bind, newSession |
| Methods inherited from class org.apache.mina.common.support.BaseIoService |
|---|
addListener, getFilterChain, getFilterChainBuilder, getListeners, getManagedServiceAddresses, getManagedSessions, isManaged, removeListener, setFilterChainBuilder |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.mina.common.IoService |
|---|
addListener, getFilterChain, getFilterChainBuilder, getManagedServiceAddresses, getManagedSessions, isManaged, removeListener, setFilterChainBuilder |
| Constructor Detail |
|---|
public SocketAcceptor()
public SocketAcceptor(int processorCount,
Executor executor)
processorCount - Number of processing threadsexecutor - Executor to use for launching threads| Method Detail |
|---|
public void bind(SocketAddress address,
IoHandler handler,
IoServiceConfig config)
throws IOException
address and handles incoming connections with the specified
handler. Backlog value is configured to the value of backlog property.
config - the configuration
IOException - if failed to bindpublic void unbind(SocketAddress address)
IoAcceptoraddress and disconnects all clients
connected there.
public void unbindAll()
IoAcceptor
public SocketAcceptorConfig getDefaultConfig()
IoService
public void setDefaultConfig(SocketAcceptorConfig defaultConfig)
defaultConfig - the default config.
NullPointerException - if the specified value is null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||