public interface IoSession extends Closeable
Modifier and Type | Method and Description |
---|---|
CloseFuture |
close(boolean immediately)
Closes this session immediately or after all queued write requests
are flushed.
|
Object |
getAttribute(Object key)
Returns the value of the user-defined attribute of this session.
|
long |
getId() |
SocketAddress |
getLocalAddress() |
SocketAddress |
getRemoteAddress() |
IoService |
getService() |
Object |
setAttribute(Object key,
Object value)
Sets a user-defined attribute.
|
IoWriteFuture |
write(Buffer buffer)
Write a packet on the socket.
|
long 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 attributeSocketAddress getRemoteAddress()
SocketAddress getLocalAddress()
IoWriteFuture write(Buffer buffer)
buffer
- The Buffer
with the encoded packet dataIoWriteFuture
for the requestCloseFuture close(boolean immediately)
CloseFuture
if you want to wait for the session actually closed.immediately
- true
to close this session immediately.
The pending write requests will simply be discarded.
false
to close this session after all queued
write requests are flushed.CloseFuture
Copyright © 2008–2016 The Apache Software Foundation. All rights reserved.