public class UdpKernel extends AbstractKernel
| Modifier and Type | Class and Description |
|---|---|
protected class |
UdpKernel.HostThread |
protected class |
UdpKernel.MessageWriter |
EVENTS_PENDING| Constructor and Description |
|---|
UdpKernel(java.net.InetAddress host,
int port) |
UdpKernel(java.net.InetSocketAddress address) |
UdpKernel(int port) |
| Modifier and Type | Method and Description |
|---|---|
void |
broadcast(Filter<? super Endpoint> filter,
java.nio.ByteBuffer data,
boolean reliable,
boolean copy)
Dispatches the data to all endpoints managed by the
kernel.
|
protected void |
closeEndpoint(UdpEndpoint p)
Called by the endpoints when they need to be closed.
|
protected UdpKernel.HostThread |
createHostThread() |
protected void |
enqueueWrite(Endpoint endpoint,
java.net.DatagramPacket packet) |
protected Endpoint |
getEndpoint(java.net.SocketAddress address,
boolean create) |
void |
initialize()
Initializes the kernel and starts any internal processing.
|
protected void |
newData(java.net.DatagramPacket packet) |
void |
terminate()
Gracefully terminates the kernel and stops any internal
daemon processing.
|
addEnvelope, addEvent, hasEnvelopes, nextEndpointId, nextEvent, read, reportError, wakeupReaderpublic UdpKernel(java.net.InetAddress host,
int port)
public UdpKernel(int port)
throws java.io.IOException
java.io.IOExceptionpublic UdpKernel(java.net.InetSocketAddress address)
protected UdpKernel.HostThread createHostThread()
public void initialize()
Kernelpublic void terminate()
throws java.lang.InterruptedException
Kerneljava.lang.InterruptedExceptionpublic void broadcast(Filter<? super Endpoint> filter, java.nio.ByteBuffer data, boolean reliable, boolean copy)
protected Endpoint getEndpoint(java.net.SocketAddress address, boolean create)
protected void closeEndpoint(UdpEndpoint p) throws java.io.IOException
java.io.IOExceptionprotected void newData(java.net.DatagramPacket packet)
protected void enqueueWrite(Endpoint endpoint, java.net.DatagramPacket packet)