public interface IoSession extends PacketWriter, Closeable
CLOSE_WAIT_TIMEOUT, DEFAULT_CLOSE_WAIT_TIMEOUT
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getAttribute(java.lang.Object key)
Returns the value of the user-defined attribute of this session.
|
long |
getId() |
java.net.SocketAddress |
getLocalAddress() |
java.net.SocketAddress |
getRemoteAddress() |
IoService |
getService() |
java.lang.Object |
removeAttribute(java.lang.Object key)
Removes a user-defined attribute with the specified key.
|
java.lang.Object |
setAttribute(java.lang.Object key,
java.lang.Object value)
Sets a user-defined attribute.
|
java.lang.Object |
setAttributeIfAbsent(java.lang.Object key,
java.lang.Object value)
Sets a user defined attribute if the attribute with the specified key
is not set yet.
|
writePacket
addCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListener
long getId()
java.lang.Object getAttribute(java.lang.Object key)
key
- the key of the attributejava.lang.Object setAttribute(java.lang.Object key, java.lang.Object value)
key
- the key of the attributevalue
- the value of the attributejava.lang.Object setAttributeIfAbsent(java.lang.Object key, java.lang.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 setjava.lang.Object removeAttribute(java.lang.Object key)
key
- The key of the attribute we want to removejava.net.SocketAddress getRemoteAddress()
java.net.SocketAddress getLocalAddress()