org.apache.mina.transport.socket.nio
Class SocketConnector
- IoConnector, IoService
public class SocketConnector
SocketConnector() - Create a connector with a single processing thread using a NewThreadExecutor
|
SocketConnector(int processorCount, Executor executor) - Create a connector with the desired number of processing threads
|
SocketConnector
public SocketConnector()
Create a connector with a single processing thread using a NewThreadExecutor
SocketConnector
public SocketConnector(int processorCount,
Executor executor)
Create a connector with the desired number of processing threads
processorCount
- Number of processing threadsexecutor
- Executor to use for launching threads
getWorkerTimeout
public int getWorkerTimeout()
How many seconds to keep the connection thread alive between connection requests
- the number of seconds to keep connection thread alive.
0 means that the connection thread will terminate immediately
when there's no connection to make.
setDefaultConfig
public void setDefaultConfig(SocketConnectorConfig defaultConfig)
Sets the config this connector will use by default.
defaultConfig
- the default config.
setWorkerTimeout
public void setWorkerTimeout(int workerTimeout)
Set how many seconds the connection worker thread should remain alive once idle before terminating itself.
workerTimeout
- the number of seconds to keep thread alive.
Must be >=0. If 0 is specified, the connection
worker thread will terminate immediately when
there's no connection to make.