public interface IoSession extends PacketWriter, Closeable
CLOSE_WAIT_TIMEOUT, DEFAULT_CLOSE_WAIT_TIMEOUT| Modifier and Type | Method and Description |
|---|---|
Object |
getAttribute(Object key)
Returns the value of the user-defined attribute of this session.
|
long |
getId() |
SocketAddress |
getLocalAddress() |
SocketAddress |
getRemoteAddress() |
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.
|
writePacketaddCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListenerlong getId()
Object getAttribute(Object key)
key - the key of the attributeObject setAttribute(Object key, Object value)
key - the key of the attributevalue - the value of the attributeObject 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 setObject removeAttribute(Object key)
key - The key of the attribute we want to removeSocketAddress getRemoteAddress()
SocketAddress getLocalAddress()
Copyright © 2008–2019 The Apache Software Foundation. All rights reserved.