Package org.omegazero.net.nio.server
Class PlainUDPServer
java.lang.Object
org.omegazero.net.nio.util.SelectorHandler
org.omegazero.net.nio.util.ConnectionSelectorHandler
org.omegazero.net.nio.server.UDPServer
org.omegazero.net.nio.server.PlainUDPServer
- All Implemented Interfaces:
Runnable,NetworkApplication,NetServer
UDPServer implementation for plaintext UDP 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.UDPServer
bindAddresses, ports, workerCreator -
Constructor Summary
ConstructorsConstructorDescriptionPlainUDPServer(Collection<InetAddress> bindAddresses, Collection<Integer> ports, Function<SocketConnection, Consumer<Runnable>> workerCreator, long idleTimeout, int receiveBufferSize) -
Method Summary
Modifier and TypeMethodDescriptionprotected ChannelConnectionhandleConnection(SelectionKey serverKey, SocketAddress remote) protected voidhandleConnectionPost(ChannelConnection connection) Methods inherited from class org.omegazero.net.nio.server.UDPServer
close, getIdleTimeout, handleSelectedKey, init, onConnectionClosed, setConnectionCallback, setIdleTimeout, start, writeBacklogStartedMethods inherited from class org.omegazero.net.nio.util.ConnectionSelectorHandler
handleConnectionClosed, loopIterationMethods inherited from class org.omegazero.net.nio.util.SelectorHandler
closeSelector, initSelector, isRunning, registerChannel, registerChannel, runSelectorLoop, selectorKeys, selectorWakeupMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.omegazero.net.common.NetworkApplication
run
-
Constructor Details
-
PlainUDPServer
public PlainUDPServer(Collection<InetAddress> bindAddresses, Collection<Integer> ports, Function<SocketConnection, Consumer<Runnable>> workerCreator, long idleTimeout, int receiveBufferSize) - See Also:
-
-
Method Details
-
handleConnection
protected ChannelConnection handleConnection(SelectionKey serverKey, SocketAddress remote) throws IOException - Specified by:
handleConnectionin classUDPServer- Throws:
IOException
-
handleConnectionPost
- Overrides:
handleConnectionPostin classUDPServer
-