public interface IoSession extends ConnectionEndpointsIndicator, PacketWriter, Closeable
CLOSE_WAIT_TIMEOUT, DEFAULT_CLOSE_WAIT_TIMEOUT
Modifier and Type | Method and Description |
---|---|
SocketAddress |
getAcceptanceAddress() |
Object |
getAttribute(Object key)
Returns the value of the user-defined attribute of this session.
|
long |
getId() |
IoService |
getService() |
Object |
removeAttribute(Object key)
Removes a user-defined attribute with the specified key.
|
Object |
setAttribute(Object key,
Object value)
Sets a user-defined attribute.
|
Object |
setAttributeIfAbsent(Object key,
Object value)
Sets a user defined attribute if the attribute with the specified key
is not set yet.
|
getLocalAddress, getRemoteAddress
writePacket
addCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListener
long getId()
SocketAddress getAcceptanceAddress()
null
if session was initiated by this peer instead of being acceptedObject getAttribute(Object key)
key
- the key of the attributenull
if there is no attribute with the specified keyObject setAttribute(Object key, Object value)
key
- the key of the attributevalue
- the value of the attributenull
if it is new.Object setAttributeIfAbsent(Object key, Object value)
if (containsAttribute(key)) {
return getAttribute(key);
} else {
return setAttribute(key, value);
}
key
- The key of the attribute we want to setvalue
- The value we want to setnull
if not found.Object removeAttribute(Object key)
key
- The key of the attribute we want to removenull
if not found.Copyright © 2008–2022 The Apache Software Foundation. All rights reserved.