public class Session extends Object implements Closeable
| Modifier and Type | Class and Description |
|---|---|
static class |
Session.SessionStatus |
| Constructor and Description |
|---|
Session(Dispatcher dispatcher,
SocketChannel channel,
IoAdaptor ioAdaptor) |
Session(Dispatcher dispatcher,
SocketChannel channel,
Object attachment,
IoAdaptor ioAdaptor) |
| Modifier and Type | Method and Description |
|---|---|
void |
asyncClose() |
<T> T |
attr(String key) |
<T> void |
attr(String key,
T value) |
void |
close() |
Dispatcher |
dispatcher() |
void |
doRead() |
protected int |
doWrite() |
boolean |
equals(Object obj) |
void |
finishConnect() |
Object |
getAttachment() |
SocketChannel |
getChannel() |
IoAdaptor |
getIoAdaptor() |
long |
getLastOperationTime() |
String |
getLocalAddress() |
SelectionKey |
getRegisteredKey() |
String |
getRemoteAddress() |
Session.SessionStatus |
getStatus() |
int |
hashCode() |
String |
id() |
int |
interestOps() |
void |
interestOps(int ops) |
void |
interestOpsAndWakeup(int ops) |
boolean |
isActive() |
boolean |
isNew() |
void |
register(int interestOps) |
protected IoBuffer |
resetIoBuffer(IoBuffer buffer) |
void |
setAttachment(Object attachment) |
void |
setRegisteredKey(SelectionKey key) |
void |
setStatus(Session.SessionStatus status) |
String |
toString() |
void |
updateLastOperationTime() |
boolean |
waitToConnect(long millis) |
void |
write(IoBuffer buf) |
void |
write(Object msg) |
public Session(Dispatcher dispatcher, SocketChannel channel, IoAdaptor ioAdaptor)
public Session(Dispatcher dispatcher, SocketChannel channel, Object attachment, IoAdaptor ioAdaptor)
public String id()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void asyncClose()
throws IOException
IOExceptionpublic void write(Object msg) throws IOException
IOExceptionpublic void write(IoBuffer buf) throws IOException
IOExceptionpublic void doRead()
throws IOException
IOExceptionprotected int doWrite()
throws IOException
IOExceptionpublic long getLastOperationTime()
public void updateLastOperationTime()
public String getRemoteAddress()
public String getLocalAddress()
public int interestOps()
throws IOException
IOExceptionpublic void register(int interestOps)
throws IOException
IOExceptionpublic void interestOps(int ops)
public void interestOpsAndWakeup(int ops)
public SelectionKey getRegisteredKey()
public void setRegisteredKey(SelectionKey key)
public Session.SessionStatus getStatus()
public boolean isActive()
public boolean isNew()
public void setStatus(Session.SessionStatus status)
public SocketChannel getChannel()
public Dispatcher dispatcher()
public void finishConnect()
public boolean waitToConnect(long millis)
public <T> T attr(String key)
public <T> void attr(String key, T value)
public Object getAttachment()
public void setAttachment(Object attachment)
public IoAdaptor getIoAdaptor()
Copyright © 2015. All rights reserved.