public abstract class AbstractSocketServer extends Object implements ISocketServer
ISocketServer
.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_TCP_BUFFERS_SIZE
SocketServer default size of the TCP buffers.
|
protected int |
listenPort
Server listening port.
|
protected int |
nWorkersCPUmultiplier
Number of worker threads to use for each available CPU.
|
protected int |
nWorkersIO
Total number of worker threads.
|
protected ISocketServerProtocolDecoderFactory |
protocolDecoderFactory
SocketServer protocolDecoderFactory.
|
protected int |
tcpBufferSizeIn
Sockets buffer input size.
|
protected int |
tcpBufferSizeOut
Sockets buffer output size.
|
protected ThreadPoolExecutor |
workerPool
SocketServer workerPool.
|
Constructor and Description |
---|
AbstractSocketServer(ISocketServerProtocolDecoderFactory protocolFactory,
int listenPort)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
setPort(int port)
Sets the server listening port.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getTotalReadBytes, getTotalSentBytes, getTransferRateIn, getTransferRateOut, run, setIP, start
public static int DEFAULT_TCP_BUFFERS_SIZE
protected int listenPort
protected int tcpBufferSizeIn
protected int tcpBufferSizeOut
protected int nWorkersCPUmultiplier
protected int nWorkersIO
protected ThreadPoolExecutor workerPool
protected ISocketServerProtocolDecoderFactory protocolDecoderFactory
public AbstractSocketServer(ISocketServerProtocolDecoderFactory protocolFactory, int listenPort)
protocolFactory
- protocol decoder factorylistenPort
- listening portpublic void setPort(int port)
setPort
in interface ISocketServer
port
- the port numbersetPort
Copyright © 2018 universAAL Consortium. All rights reserved.