Class UdpKernel.HostThread
java.lang.Object
java.lang.Thread
com.jme3.network.kernel.udp.UdpKernel.HostThread
- All Implemented Interfaces:
Runnable
- Enclosing class:
UdpKernel
Host thread that receives UDP packets for this kernel.
- Author:
- Paul Speed
-
Nested Class Summary
Nested classes/interfaces inherited from class Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
Fields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Stops the host thread and closes its socket.voidconnect()Opens and binds the host datagram socket.protected DatagramSocketReturns the datagram socket used by the host thread.voidrun()Methods inherited from class Thread
activeCount, checkAccess, clone, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, threadId, toString, yield
-
Constructor Details
-
HostThread
public HostThread()Creates the host thread.
-
-
Method Details
-
getSocket
Returns the datagram socket used by the host thread.- Returns:
- the datagram socket
-
connect
Opens and binds the host datagram socket.- Throws:
IOException- if the socket cannot be opened
-
close
Stops the host thread and closes its socket.- Throws:
IOException- if socket shutdown failsInterruptedException- if interrupted while waiting for shutdown
-
run
-