public class TCPNIOConnection extends NIOConnection
Connection implementation
for the TCPNIOTransportConnection.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 |
|---|
TCPNIOConnection(TCPNIOTransport transport,
SelectableChannel channel) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkConnectFailed(Throwable failure)
Method will be called in order to check if failure happened before
Connection was reported as connected. |
protected void |
close0(CompletionHandler<Connection> completionHandler,
boolean isClosedLocally) |
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.
|
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,
long size)
Method will be called, when some data was written on the connection
|
protected void |
preClose() |
protected void |
resetProperties() |
protected void |
setConnectCompletionHandler(CompletionHandler<Connection> connectHandler) |
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, 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, read, read, removeCloseListener, setChannel, setMaxAsyncWriteQueueSize, setProcessor, setProcessorSelector, setReadTimeout, setWriteTimeout, simulateIOEvent, write, write, write, writepublic TCPNIOConnection(TCPNIOTransport transport, SelectableChannel channel)
protected void setSelectionKey(SelectionKey selectionKey)
setSelectionKey in class NIOConnectionprotected void setSelectorRunner(SelectorRunner selectorRunner)
setSelectorRunner in class NIOConnectionprotected void preClose()
preClose 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 setConnectCompletionHandler(CompletionHandler<Connection> connectHandler)
protected final void onConnect()
throws IOException
IOExceptionprotected final void checkConnectFailed(Throwable failure)
Connection was reported as connected.IOExceptionprotected void close0(CompletionHandler<Connection> completionHandler, boolean isClosedLocally)
close0 in class NIOConnectionprotected final void onRead(Buffer data, int size)
protected final void onWrite(Buffer data, long size)
Copyright © 2013 Oracle Corporation. All Rights Reserved.