public class NIODatagramHandle extends AbstractNIOHandle
| Modifier and Type | Class and Description |
|---|---|
static class |
NIODatagramHandle.ReceivedDatagram |
AbstractNIOHandle.QueuedWrite| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_READ_BUFFER
Realistically actual UDP packets on the Internet are not gigantic.
|
queuedBytes, runtime, selKey, writeQueue, writeReady| Constructor and Description |
|---|
NIODatagramHandle(GenericNodeRuntime runtime) |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(java.lang.String address,
int port) |
void |
close() |
java.net.InetSocketAddress |
getSockName() |
protected void |
processConnect() |
protected void |
processReads() |
protected void |
processWrites() |
int |
send(java.lang.String host,
int port,
java.nio.ByteBuffer buf,
IOCompletionHandler<java.lang.Integer> handler) |
void |
setBroadcast(boolean on) |
void |
setMulticastLoopback(boolean on) |
void |
setMulticastTtl(int ttl) |
void |
startReadingDatagrams(IOCompletionHandler<NIODatagramHandle.ReceivedDatagram> handler) |
void |
stopReading() |
addInterest, clientSelected, getNetworkPolicy, queueWrite, removeInterestgetReadHandler, getWritesOutstanding, setReadHandler, startReading, write, write, writeHandle, writeHandlepublic static final int MAX_READ_BUFFER
public NIODatagramHandle(GenericNodeRuntime runtime)
public void bind(java.lang.String address,
int port)
throws OSException
OSExceptionpublic void close()
close in interface Handleclose in class AbstractHandlepublic int send(java.lang.String host,
int port,
java.nio.ByteBuffer buf,
IOCompletionHandler<java.lang.Integer> handler)
throws OSException
OSExceptionprotected void processWrites()
processWrites in class AbstractNIOHandlepublic void startReadingDatagrams(IOCompletionHandler<NIODatagramHandle.ReceivedDatagram> handler)
public void stopReading()
stopReading in interface HandlestopReading in class AbstractHandleprotected void processReads()
processReads in class AbstractNIOHandleprotected void processConnect()
processConnect in class AbstractNIOHandlepublic java.net.InetSocketAddress getSockName()
public void setBroadcast(boolean on)
throws OSException
OSExceptionpublic void setMulticastTtl(int ttl)
throws OSException
OSExceptionpublic void setMulticastLoopback(boolean on)
throws OSException
OSExceptionCopyright © 2018 Apigee Corporation. All Rights Reserved.