public interface IoSession extends ConnectionEndpointsIndicator, PacketWriter, Closeable
CLOSE_WAIT_TIMEOUT, DEFAULT_CLOSE_WAIT_TIMEOUT| Modifier and Type | Method and Description |
|---|---|
java.net.SocketAddress |
getAcceptanceAddress() |
java.lang.Object |
getAttribute(java.lang.Object key)
Returns the value of the user-defined attribute of this session.
|
long |
getId() |
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.
|
void |
shutdownOutputStream()
Handle received EOF.
|
getLocalAddress, getRemoteAddresscalculatePadLength, writePacketaddCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListenerlong getId()
java.net.SocketAddress getAcceptanceAddress()
null if session was initiated by
this peer instead of being acceptedjava.lang.Object getAttribute(java.lang.Object key)
key - the key of the attributenull if there is no attribute with the specified keyjava.lang.Object setAttribute(java.lang.Object key,
java.lang.Object value)
key - the key of the attributevalue - the value of the attributenull if it is new.java.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 setnull if not found.java.lang.Object removeAttribute(java.lang.Object key)
key - The key of the attribute we want to removenull if not found.void shutdownOutputStream()
throws java.io.IOException
java.io.IOException - If failed to shutdown the stream