| Modifier and Type | Field and Description |
|---|---|
| private final SocketAddress | |
| private final Map | |
| private final AtomicReference | |
| public static final int | |
| private final long | |
| private final IoHandler | |
| private final AtomicLong | |
| private final AtomicLong | |
| private final SocketAddress | |
| private final AtomicBoolean | |
| private final PropertyResolver | |
| private final AtomicLong | |
| private Thread | |
| private volatile Runnable | |
| private final SocketAddress | |
| private final Nio2Service | |
| private static final AtomicLong | |
| private final AsynchronousSocketChannel | |
| private volatile boolean | |
| private final Object | |
| private final AtomicLong | |
| private final Queue |
| Access | Constructor and Description |
|---|---|
| public | Nio2Session(Nio2Service service, PropertyResolver propertyResolver, IoHandler handler, AsynchronousSocketChannel socket, SocketAddress acceptanceAddress)
|
| Modifier and Type | Method and Description |
|---|---|
| protected Nio2CompletionHandler | |
| protected Nio2CompletionHandler | createWriteCycleCompletionHandler(Nio2DefaultIoWriteFuture future, AsynchronousSocketChannel socket, ByteBuffer buffer)
|
| protected CloseFuture | |
| protected void | doCloseImmediately()
Overrides org. doCloseImmediately is called once and only once with state == Immediate Overriding methods should always call the base implementation. |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| public SocketAddress | |
| public Object | getAttribute(Object
the key of the attribute key)Implements org. Returns the value of the user-defined attribute of this session. |
| public long | |
| public IoHandler | |
| public SocketAddress | |
| public SocketAddress | |
| public Nio2Service | |
| public AsynchronousSocketChannel | |
| protected void | handleCompletedWriteCycle(Nio2DefaultIoWriteFuture future, AsynchronousSocketChannel socket, ByteBuffer buffer, int writeLen, Nio2CompletionHandler<Integer, Object> completionHandler, Integer result, Object attachment)
|
| protected void | handleReadCycleCompletion(ByteBuffer buffer, Readable bufReader, Nio2CompletionHandler<Integer, Object> completionHandler, Integer result, Object attachment)
|
| protected void | |
| protected void | handleWriteCycleFailure(Nio2DefaultIoWriteFuture future, AsynchronousSocketChannel socket, ByteBuffer buffer, int writeLen, Throwable exc, Object attachment)
|
| public Object | removeAttribute(Object
The key of the attribute we want to remove key)Implements org. Removes a user-defined attribute with the specified key. |
| public void | resumeRead()
Implements org. Resume read operations on this session. |
| public Object | setAttribute(Object
the key of the attribute key, Object the value of the attribute value)Implements org. Sets a user-defined attribute. |
| public Object | setAttributeIfAbsent(Object
The key of the attribute we want to set key, Object The value we want to set value)Implements org. Sets a user defined attribute if the attribute with the specified key is not set yet. |
| public void | shutdownOutputStream()
Implements org. Handle received EOF. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| protected void | |
| public void | |
| public void | suspendRead()
Implements org. Suspend read operations on this session. |
| public String | |
| public IoWriteFuture | writeBuffer(Buffer
the buffer send buffer)Note the buffer must not be touched until the returned write future is completed. Implements org. Write a packet on the socket. |
| acceptanceAddress | back to summary |
|---|---|
| private final SocketAddress acceptanceAddress | |
| attributes | back to summary |
|---|---|
| private final Map<Object, Object> attributes | |
| currentWrite | back to summary |
|---|---|
| private final AtomicReference<Nio2DefaultIoWriteFuture> currentWrite | |
| DEFAULT_READBUF_SIZE | back to summary |
|---|---|
| public static final int DEFAULT_READBUF_SIZE | |
| id | back to summary |
|---|---|
| private final long id | |
| ioHandler | back to summary |
|---|---|
| private final IoHandler ioHandler | |
| lastReadCycleStart | back to summary |
|---|---|
| private final AtomicLong lastReadCycleStart | |
| lastWriteCycleStart | back to summary |
|---|---|
| private final AtomicLong lastWriteCycleStart | |
| localAddress | back to summary |
|---|---|
| private final SocketAddress localAddress | |
| outputShutDown | back to summary |
|---|---|
| private final AtomicBoolean outputShutDown | |
| propertyResolver | back to summary |
|---|---|
| private final PropertyResolver propertyResolver | |
| readCyclesCounter | back to summary |
|---|---|
| private final AtomicLong readCyclesCounter | |
| readerThread | back to summary |
|---|---|
| private Thread readerThread | |
| readRunnable | back to summary |
|---|---|
| private volatile Runnable readRunnable | |
| remoteAddress | back to summary |
|---|---|
| private final SocketAddress remoteAddress | |
| service | back to summary |
|---|---|
| private final Nio2Service service | |
| SESSION_ID_GENERATOR | back to summary |
|---|---|
| private static final AtomicLong SESSION_ID_GENERATOR | |
| socketChannel | back to summary |
|---|---|
| private final AsynchronousSocketChannel socketChannel | |
| suspend | back to summary |
|---|---|
| private volatile boolean suspend | |
| suspendLock | back to summary |
|---|---|
| private final Object suspendLock | |
| writeCyclesCounter | back to summary |
|---|---|
| private final AtomicLong writeCyclesCounter | |
| writes | back to summary |
|---|---|
| private final Queue<Nio2DefaultIoWriteFuture> writes | |
| Nio2Session | back to summary |
|---|---|
| public Nio2Session(Nio2Service service, PropertyResolver propertyResolver, IoHandler handler, AsynchronousSocketChannel socket, SocketAddress acceptanceAddress) throws IOException | |
| createReadCycleCompletionHandler | back to summary |
|---|---|
| protected Nio2CompletionHandler | |
| createWriteCycleCompletionHandler | back to summary |
|---|---|
| protected Nio2CompletionHandler | |
| doCloseGracefully | back to summary |
|---|---|
| protected CloseFuture doCloseGracefully() Overrides org.
| |
| doCloseImmediately | back to summary |
|---|---|
| protected void doCloseImmediately() Overrides org. Doc from org. doCloseImmediately is called once and only once with state == Immediate Overriding methods should always call the base implementation. It may be called concurrently while preClose() or doCloseGracefully is executing
| |
| doReadCycle | back to summary |
|---|---|
| protected void doReadCycle(ByteBuffer buffer, Readable bufReader) | |
| doReadCycle | back to summary |
|---|---|
| protected void doReadCycle(ByteBuffer buffer, Nio2CompletionHandler<Integer, Object> completion) | |
| doShutdownOutputStream | back to summary |
|---|---|
| protected void doShutdownOutputStream(Nio2DefaultIoWriteFuture future, AsynchronousSocketChannel socket) throws IOException | |
| doWriteCycle | back to summary |
|---|---|
| protected void doWriteCycle(ByteBuffer buffer, Nio2CompletionHandler<Integer, Object> completion) | |
| exceptionCaught | back to summary |
|---|---|
| protected void exceptionCaught(Throwable exc) | |
| finishWrite | back to summary |
|---|---|
| protected void finishWrite(Nio2DefaultIoWriteFuture future) | |
| getAcceptanceAddress | back to summary |
|---|---|
| public SocketAddress getAcceptanceAddress() Implements org.
| |
| getAttribute | back to summary |
|---|---|
| public Object getAttribute(Object key) Implements org. Doc from org. Returns the value of the user-defined attribute of this session. | |
| getId | back to summary |
|---|---|
| public long getId() Implements org.
| |
| getIoHandler | back to summary |
|---|---|
| public IoHandler getIoHandler() | |
| getLocalAddress | back to summary |
|---|---|
| public SocketAddress getLocalAddress() Implements org.
| |
| getRemoteAddress | back to summary |
|---|---|
| public SocketAddress getRemoteAddress() Implements org.
| |
| getService | back to summary |
|---|---|
| public Nio2Service getService() Implements org.
| |
| getSocket | back to summary |
|---|---|
| public AsynchronousSocketChannel getSocket() | |
| handleCompletedWriteCycle | back to summary |
|---|---|
| protected void handleCompletedWriteCycle(Nio2DefaultIoWriteFuture future, AsynchronousSocketChannel socket, ByteBuffer buffer, int writeLen, Nio2CompletionHandler<Integer, Object> completionHandler, Integer result, Object attachment) | |
| handleReadCycleCompletion | back to summary |
|---|---|
| protected void handleReadCycleCompletion(ByteBuffer buffer, Readable bufReader, Nio2CompletionHandler<Integer, Object> completionHandler, Integer result, Object attachment) | |
| handleReadCycleFailure | back to summary |
|---|---|
| protected void handleReadCycleFailure(ByteBuffer buffer, Readable bufReader, Throwable exc, Object attachment) | |
| handleWriteCycleFailure | back to summary |
|---|---|
| protected void handleWriteCycleFailure(Nio2DefaultIoWriteFuture future, AsynchronousSocketChannel socket, ByteBuffer buffer, int writeLen, Throwable exc, Object attachment) | |
| removeAttribute | back to summary |
|---|---|
| public Object removeAttribute(Object key) Implements org. Doc from org. Removes a user-defined attribute with the specified key. | |
| resumeRead | back to summary |
|---|---|
| public void resumeRead() Implements org. Doc from org. Resume read operations on this session.
| |
| setAttribute | back to summary |
|---|---|
| public Object setAttribute(Object key, Object value) Implements org. Doc from org. Sets a user-defined attribute. | |
| setAttributeIfAbsent | back to summary |
|---|---|
| public Object setAttributeIfAbsent(Object key, Object value) Implements org. Doc from org. Sets a user defined attribute if the attribute with the specified key is not set yet. This method is same with the following code except that the operation is performed atomically.
| |
| shutdownOutputStream | back to summary |
|---|---|
| public void shutdownOutputStream() throws IOException Implements org. Doc from org. Handle received EOF.
| |
| startReading | back to summary |
|---|---|
| public void startReading() | |
| startReading | back to summary |
|---|---|
| public void startReading(int bufSize) | |
| startReading | back to summary |
|---|---|
| public void startReading(byte[] buf) | |
| startReading | back to summary |
|---|---|
| public void startReading(byte[] buf, int offset, int len) | |
| startReading | back to summary |
|---|---|
| public void startReading(ByteBuffer buffer) | |
| startWriting | back to summary |
|---|---|
| protected void startWriting() | |
| suspend | back to summary |
|---|---|
| public void suspend() Intended for tests simulating a sudden connection drop only! Do not call otherwise. | |
| suspendRead | back to summary |
|---|---|
| public void suspendRead() Implements org. Doc from org. Suspend read operations on this session. If the session usage includes a graceful shutdown with messages being exchanged, the caller needs to take care of resuming reading the input in order to actually be able to carry on the conversation with the peer.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| writeBuffer | back to summary |
|---|---|
| public IoWriteFuture writeBuffer(Buffer buffer) throws IOException Implements org. Doc from org. Write a packet on the socket. Multiple writes can be issued concurrently and will be queued.
| |