Package com.jme3.network.kernel.udp
Class UdpKernel
java.lang.Object
com.jme3.network.kernel.AbstractKernel
com.jme3.network.kernel.udp.UdpKernel
- All Implemented Interfaces:
Kernel
A Kernel implementation using UDP packets.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
protected class
-
Field Summary
Fields inherited from interface com.jme3.network.kernel.Kernel
EVENTS_PENDING
-
Constructor Summary
ConstructorDescriptionUdpKernel
(int port) UdpKernel
(InetAddress host, int port) UdpKernel
(InetSocketAddress address) -
Method Summary
Modifier and TypeMethodDescriptionvoid
broadcast
(Filter<? super Endpoint> filter, ByteBuffer data, boolean reliable, boolean copy) Dispatches the data to all endpoints managed by the kernel.protected void
Called by the endpoints when they need to be closed.protected UdpKernel.HostThread
protected void
enqueueWrite
(Endpoint endpoint, DatagramPacket packet) protected Endpoint
getEndpoint
(SocketAddress address, boolean create) void
Initializes the kernel and starts any internal processing.protected void
newData
(DatagramPacket packet) void
Gracefully terminates the kernel and stops any internal daemon processing.Methods inherited from class com.jme3.network.kernel.AbstractKernel
addEnvelope, addEvent, hasEnvelopes, nextEndpointId, nextEvent, read, reportError, wakeupReader
-
Constructor Details
-
UdpKernel
-
UdpKernel
- Throws:
IOException
-
UdpKernel
-
-
Method Details
-
createHostThread
-
initialize
public void initialize()Description copied from interface:Kernel
Initializes the kernel and starts any internal processing. -
terminate
Description copied from interface:Kernel
Gracefully terminates the kernel and stops any internal daemon processing. This method will not return until all internal threads have been shut down.- Throws:
InterruptedException
-
broadcast
public void broadcast(Filter<? super Endpoint> filter, ByteBuffer data, boolean reliable, boolean copy) Dispatches the data to all endpoints managed by the kernel. 'routing' is currently ignored. -
getEndpoint
-
closeEndpoint
Called by the endpoints when they need to be closed.- Throws:
IOException
-
newData
-
enqueueWrite
-