public final class TCPNIOServerConnection extends TCPNIOConnection
Modifier and Type | Class and Description |
---|---|
protected class |
TCPNIOServerConnection.RegisterAcceptedChannelCompletionHandler |
TCPNIOConnection.ConnectResultHandler
Connection.CloseListener, Connection.CloseType
asyncReadQueue, asyncWriteQueue, attributes, channel, connectCloseSemaphor, isBlocking, isStandalone, maxAsyncWriteQueueSize, monitoringConfig, NOTIFICATION_CLOSED_COMPLETE, NOTIFICATION_INITIALIZED, processor, processorSelector, readTimeoutMillis, selectionKey, selectorRunner, transport, writeTimeoutMillis, zeroByteReadCount
Constructor and Description |
---|
TCPNIOServerConnection(TCPNIOTransport transport,
ServerSocketChannel serverSocketChannel) |
Modifier and Type | Method and Description |
---|---|
GrizzlyFuture<Connection> |
accept()
Accept a
Connection . |
protected GrizzlyFuture<Connection> |
acceptAsync()
Asynchronously accept a
Connection |
protected void |
closeGracefully0(CompletionHandler<Closeable> completionHandler,
CloseReason closeReason) |
int |
getReadBufferSize()
Get the default size of
Buffer s, which will be allocated for
reading data from Connection . |
int |
getWriteBufferSize()
Get the default size of
Buffer s, which will be allocated for
writing data to Connection . |
boolean |
isBlocking() |
boolean |
isStandalone() |
void |
listen() |
void |
onAccept()
Method will be called by framework, when async accept will be ready
|
void |
preClose() |
protected void |
resetProperties() |
void |
setReadBufferSize(int readBufferSize)
Set the default size of
Buffer s, which will be allocated for
reading data from Connection . |
void |
setWriteBufferSize(int writeBufferSize)
Set the default size of
Buffer s, which will be allocated for
writing data to Connection . |
canWrite, canWrite, checkConnectFailed, enableInitialOpRead, getLocalAddress, getPeerAddress, notifyCanWrite, notifyCanWrite, notifyReady, onConnect, onRead, onWrite, setConnectResultHandler, setSelectionKey, setSelectorRunner, terminate0, toString
addCloseListener, addCloseListener, assertOpen, attachToSelectorRunner, checkEmptyRead, close, close, closeSilently, closeWithReason, configureBlocking, configureStandalone, detachSelectorRunner, disableIOEvent, doClose, enableIOEvent, executeInEventThread, getAsyncReadQueue, getAsyncWriteQueue, getAttributes, getChannel, getCloseReason, getMaxAsyncWriteQueueSize, getMemoryManager, getMonitoringConfig, getProcessor, getProcessorSelector, getReadTimeout, getSelectionKey, getSelectorRunner, getTransport, getWriteTimeout, isClosed, isOpen, notifyConnectionError, notifyIOEventDisabled, notifyIOEventEnabled, notifyIOEventReady, notifyProbesAccept, notifyProbesBind, notifyProbesClose, notifyProbesConnect, notifyProbesError, notifyProbesRead, notifyProbesWrite, obtainProcessor, obtainProcessorState, read, read, removeCloseListener, removeCloseListener, setChannel, setMaxAsyncWriteQueueSize, setProcessor, setProcessorSelector, setReadTimeout, setWriteTimeout, simulateIOEvent, terminate, terminateSilently, terminateWithReason, write, write, write, write, write
public TCPNIOServerConnection(TCPNIOTransport transport, ServerSocketChannel serverSocketChannel)
public void listen() throws IOException
IOException
public boolean isBlocking()
isBlocking
in interface Connection<SocketAddress>
isBlocking
in class NIOConnection
Connection
mode.
true, if Connection
is operating in blocking mode, or
false otherwise.public boolean isStandalone()
isStandalone
in interface Connection<SocketAddress>
isStandalone
in class NIOConnection
public GrizzlyFuture<Connection> accept() throws IOException
Connection
. Could be used only in standalone mode.
See Connection.configureStandalone(boolean)
.Future
IOException
protected GrizzlyFuture<Connection> acceptAsync() throws IOException
Connection
Future
IOException
public void preClose()
preClose
in class TCPNIOConnection
public void onAccept() throws IOException
IOException
public void setReadBufferSize(int readBufferSize)
TCPNIOConnection
Buffer
s, which will be allocated for
reading data from Connection
.
The value less or equal to zero will be ignored.setReadBufferSize
in interface Connection<SocketAddress>
setReadBufferSize
in class TCPNIOConnection
readBufferSize
- the default size of Buffer
s, which will
be allocated for reading data from Connection
.public void setWriteBufferSize(int writeBufferSize)
TCPNIOConnection
Buffer
s, which will be allocated for
writing data to Connection
.setWriteBufferSize
in interface Connection<SocketAddress>
setWriteBufferSize
in class TCPNIOConnection
writeBufferSize
- the default size of Buffer
s, which will
be allocated for writing data to Connection
.public int getReadBufferSize()
TCPNIOConnection
Buffer
s, which will be allocated for
reading data from Connection
.
The value less or equal to zero will be ignored.getReadBufferSize
in interface Connection<SocketAddress>
getReadBufferSize
in class TCPNIOConnection
Buffer
s, which will be allocated for
reading data from Connection
.public int getWriteBufferSize()
TCPNIOConnection
Buffer
s, which will be allocated for
writing data to Connection
.getWriteBufferSize
in interface Connection<SocketAddress>
getWriteBufferSize
in class TCPNIOConnection
Buffer
s, which will be allocated for
writing data to Connection
.protected void closeGracefully0(CompletionHandler<Closeable> completionHandler, CloseReason closeReason)
closeGracefully0
in class NIOConnection
protected void resetProperties()
resetProperties
in class TCPNIOConnection
Copyright © 2015 Oracle Corporation. All rights reserved.