public class UDPNIOConnection extends NIOConnection
Connection implementation
for the UDPNIOTransportConnection.CloseListener, Connection.CloseTypeasyncReadQueue, asyncWriteQueue, attributes, channel, closeTypeFlag, connectCloseSemaphor, isBlocking, isStandalone, maxAsyncWriteQueueSize, monitoringConfig, NOTIFICATION_CLOSED_COMPLETE, NOTIFICATION_INITIALIZED, processor, processorSelector, readBufferSize, readTimeoutMillis, selectionKey, selectorRunner, transport, writeBufferSize, writeTimeoutMillis, zeroByteReadCount| Constructor and Description |
|---|
UDPNIOConnection(UDPNIOTransport transport,
DatagramChannel channel) |
| Modifier and Type | Method and Description |
|---|---|
SocketAddress |
getLocalAddress()
Returns the local address of this Connection,
or null if it is unconnected.
|
SocketAddress |
getPeerAddress()
Returns the address of the endpoint this Connection is
connected to, or null if it is unconnected.
|
boolean |
isConnected() |
protected boolean |
notifyReady() |
protected void |
onConnect()
Method will be called, when the connection gets connected.
|
protected void |
onRead(Buffer data,
int size)
Method will be called, when some data was read on the connection
|
protected void |
onWrite(Buffer data,
int size)
Method will be called, when some data was written on the connection
|
protected void |
resetProperties() |
void |
setReadBufferSize(int readBufferSize)
Set the default size of
Buffers, which will be allocated for
reading data from Connection. |
protected void |
setSelectionKey(SelectionKey selectionKey) |
protected void |
setSelectorRunner(SelectorRunner selectorRunner) |
void |
setWriteBufferSize(int writeBufferSize)
Set the default size of
Buffers, which will be allocated for
writing data to Connection. |
String |
toString() |
addCloseListener, attachToSelectorRunner, checkEmptyRead, close, close, close0, closeSilently, configureBlocking, configureStandalone, detachSelectorRunner, disableIOEvent, enableIOEvent, getAsyncReadQueue, getAsyncWriteQueue, getAttributes, getChannel, getMaxAsyncWriteQueueSize, getMonitoringConfig, getProcessor, getProcessorSelector, getReadBufferSize, getReadTimeout, getSelectionKey, getSelectorRunner, getTransport, getWriteBufferSize, getWriteTimeout, isBlocking, isOpen, isStandalone, notifyConnectionError, notifyIOEventDisabled, notifyIOEventEnabled, notifyIOEventReady, notifyProbesAccept, notifyProbesBind, notifyProbesClose, notifyProbesConnect, notifyProbesError, notifyProbesRead, notifyProbesWrite, obtainProcessor, obtainProcessorState, preClose, read, read, removeCloseListener, setChannel, setMaxAsyncWriteQueueSize, setProcessor, setProcessorSelector, setReadTimeout, setWriteTimeout, simulateIOEvent, write, write, write, writepublic UDPNIOConnection(UDPNIOTransport transport, DatagramChannel channel)
public boolean isConnected()
protected void setSelectionKey(SelectionKey selectionKey)
setSelectionKey in class NIOConnectionprotected void setSelectorRunner(SelectorRunner selectorRunner)
setSelectorRunner in class NIOConnectionprotected boolean notifyReady()
public SocketAddress getPeerAddress()
public SocketAddress getLocalAddress()
protected final void resetProperties()
public void setReadBufferSize(int readBufferSize)
ConnectionBuffers, which will be allocated for
reading data from Connection.setReadBufferSize in interface Connection<SocketAddress>setReadBufferSize in class NIOConnectionreadBufferSize - the default size of Buffers, which will
be allocated for reading data from Connection.public void setWriteBufferSize(int writeBufferSize)
ConnectionBuffers, which will be allocated for
writing data to Connection.setWriteBufferSize in interface Connection<SocketAddress>setWriteBufferSize in class NIOConnectionwriteBufferSize - the default size of Buffers, which will
be allocated for writing data to Connection.protected final void onConnect()
throws IOException
IOExceptionprotected final void onRead(Buffer data, int size)
protected final void onWrite(Buffer data, int size)
Copyright © 2013 Oracle Corporation. All Rights Reserved.