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
Nested ClassesModifier and TypeClassDescriptionprotected classprotected class -
Field Summary
Fields inherited from interface com.jme3.network.kernel.Kernel
EVENTS_PENDING -
Constructor Summary
ConstructorsConstructorDescriptionUdpKernel(int port) UdpKernel(InetAddress host, int port) UdpKernel(InetSocketAddress address) -
Method Summary
Modifier and TypeMethodDescriptionvoidbroadcast(Filter<? super Endpoint> filter, ByteBuffer data, boolean reliable, boolean copy) Dispatches the data to all endpoints managed by the kernel.protected voidCalled by the endpoints when they need to be closed.protected UdpKernel.HostThreadprotected voidenqueueWrite(Endpoint endpoint, DatagramPacket packet) protected EndpointgetEndpoint(SocketAddress address, boolean create) voidInitializes the kernel and starts any internal processing.protected voidnewData(DatagramPacket packet) voidGracefully 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:KernelInitializes the kernel and starts any internal processing. -
terminate
Description copied from interface:KernelGracefully 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
-