Package org.omegazero.net.nio.server
Class PlainTCPServer
java.lang.Object
org.omegazero.net.nio.util.SelectorHandler
org.omegazero.net.nio.util.ConnectionSelectorHandler
org.omegazero.net.nio.server.TCPServer
org.omegazero.net.nio.server.PlainTCPServer
- All Implemented Interfaces:
Runnable
,NetworkApplication
,NetServer
TCPServer
implementation for plaintext TCP sockets.- API Note:
- Before version 2.1.0, this class was in package
org.omegazero.net.server
.
-
Field Summary
Fields inherited from class org.omegazero.net.nio.server.TCPServer
backlog, bindAddresses, ports, workerCreator
-
Constructor Summary
ConstructorsConstructorDescriptionPlainTCPServer
(Collection<InetAddress> bindAddresses, Collection<Integer> ports, int backlog, Function<SocketConnection, Consumer<Runnable>> workerCreator, long idleTimeout) -
Method Summary
Modifier and TypeMethodDescriptionprotected ChannelConnection
handleConnection
(SelectionKey selectionKey) protected void
handleConnectionPost
(ChannelConnection connection) Methods inherited from class org.omegazero.net.nio.server.TCPServer
close, getBacklog, getIdleTimeout, handleConnectionClosed, handleSelectedKey, init, setConnectionCallback, setIdleTimeout, start
Methods inherited from class org.omegazero.net.nio.util.ConnectionSelectorHandler
loopIteration, onConnectionClosed
Methods inherited from class org.omegazero.net.nio.util.SelectorHandler
closeSelector, initSelector, isRunning, registerChannel, registerChannel, runSelectorLoop, selectorKeys, selectorWakeup
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.omegazero.net.common.NetworkApplication
run
-
Constructor Details
-
PlainTCPServer
public PlainTCPServer(Collection<InetAddress> bindAddresses, Collection<Integer> ports, int backlog, Function<SocketConnection, Consumer<Runnable>> workerCreator, long idleTimeout) - See Also:
-
-
Method Details
-
handleConnection
- Specified by:
handleConnection
in classTCPServer
- Throws:
IOException
-
handleConnectionPost
- Overrides:
handleConnectionPost
in classTCPServer
-