DEFAULT_BACKLOG
autoClose, DEFAULT_PORT, port, sessionRefCounter, started
Constructor and Description |
---|
NIOTCPServer()
Creates server with default port.
|
NIOTCPServer(int port)
Creates server.
|
NIOTCPServer(int port,
boolean enableNagle)
Creates server.
|
NIOTCPServer(int port,
boolean enableNagle,
String nic)
Creates server.
|
NIOTCPServer(int port,
boolean enableNagle,
String nic,
int sendBufferSize,
int receiveBufferSize,
Map<String,Object> connectivityParams)
Creates server.
|
Modifier and Type | Method and Description |
---|---|
void |
setConnectivityParams(Map<String,Object> connectivityParams) |
void |
setIncomingConnectionListener(ConnectionListener listener)
Sets the connection listener.
|
void |
start()
Start the server.
|
void |
stop()
Stop server.
|
createServerSocket, createServerSocket, setIncomingConnectionExecutor, setServerSocketFactory, toString
decrementRefCounter, getPort, incrementRefCounter, isAutoClose, isStarted, setAutoClose, setPort, setStarted
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
asAbstract, isAbstract
public NIOTCPServer()
public NIOTCPServer(int port)
port
- - server portpublic NIOTCPServer(int port, boolean enableNagle)
port
- - server portenableNagle
- - enable/disable nagle algorithmpublic NIOTCPServer(int port, boolean enableNagle, String nic, int sendBufferSize, int receiveBufferSize, Map<String,Object> connectivityParams)
port
- server portenableNagle
- enable/disable nagle algorithmsendBufferSize
- send buffer sizereceiveBufferSize
- receive buffer sizeconnectivityParams
- connectivity params for transportpublic NIOTCPServer(int port, boolean enableNagle, String nic)
port
- - server portenableNagle
- - enable/disable nagle algorithmnic
- - specific connection addresspublic void setIncomingConnectionListener(ConnectionListener listener)
Server
setIncomingConnectionListener
in interface Server
setIncomingConnectionListener
in class TCPServer
listener
- the connection listenerServer.setIncomingConnectionListener(com.epam.common.transport.server.ConnectionListener)
public void start() throws IOException
Server
start
in interface Server
start
in class TCPServer
IOException
- - if error occurredServer.start()
public void stop() throws IOException
Server
stop
in interface Server
stop
in class TCPServer
IOException
- - if error occurredServer.stop()
Copyright © 2000–2022 EPAM Systems. All rights reserved.