An EndPoint implementation based on DatagramChannel.
| Modifier and Type | Field and Description |
|---|---|
| public static final SocketAddress | |
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| public | DatagramChannelEndPoint(DatagramChannel channel, ManagedSelector selector, SelectionKey key, Scheduler scheduler)
|
| Modifier and Type | Method and Description |
|---|---|
| public DatagramChannel | |
| public SocketAddress | getRemoteSocketAddress()
Overrides default org. Implements abstract org.
|
| public SocketAddress | Returns: the peer address that sent the datathe buffer to fill with data buffer)Receives data into the given buffer from the returned address. |
| public boolean | Returns: true if all the buffers have been consumedthe peer address to send data to address, ByteBuffer... the buffers containing the data to send buffers)Sends to the given address the data in the given buffers. |
| public void | write(Callback
the callback to notify of the success or failure of the write operation callback, SocketAddress the peer address to send data to address, ByteBuffer... the buffers containing the data to send buffers)Writes to the given address the data contained in the given buffers, and invokes the given callback when either all the data has been sent, or a failure occurs. |
| EOF | back to summary |
|---|---|
| public static final SocketAddress EOF | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| DatagramChannelEndPoint | back to summary |
|---|---|
| public DatagramChannelEndPoint(DatagramChannel channel, ManagedSelector selector, SelectionKey key, Scheduler scheduler) | |
| getChannel | back to summary |
|---|---|
| public DatagramChannel getChannel() Overrides org.
| |
| getRemoteSocketAddress | back to summary |
|---|---|
| public SocketAddress getRemoteSocketAddress() Overrides default org. Implements abstract org.
| |
| receive | back to summary |
|---|---|
| public SocketAddress receive(ByteBuffer buffer) throws IOException Receives data into the given buffer from the returned address. This method should be used to receive UDP data.
| |
| send | back to summary |
|---|---|
| public boolean send(SocketAddress address, ByteBuffer... buffers) throws IOException Sends to the given address the data in the given buffers. This methods should be used to send UDP data.
| |
| write | back to summary |
|---|---|
| public void write(Callback callback, SocketAddress address, ByteBuffer... buffers) throws WritePendingException Writes to the given address the data contained in the given buffers, and invokes the given callback when either all the data has been sent, or a failure occurs.
| |