public class Session extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Session.SessionStatus |
| Constructor and Description |
|---|
Session(DispatcherManager dispatcherManager,
SocketChannel channel,
EventAdaptor eventAdaptor) |
Session(DispatcherManager dispatcherManager,
SocketChannel channel,
Object attachment,
EventAdaptor eventAdaptor) |
| Modifier and Type | Method and Description |
|---|---|
void |
asyncClose() |
<T> T |
attr(String key) |
<T> void |
attr(String key,
T value) |
void |
close() |
DispatcherManager |
dispatcherManager() |
void |
doRead() |
protected int |
doWrite() |
boolean |
equals(Object obj) |
void |
finishConnect() |
Object |
getAttachment() |
SocketChannel |
getChannel() |
EventAdaptor |
getEventAdaptor() |
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(DispatcherManager dispatcherManager, SocketChannel channel, EventAdaptor eventAdaptor)
public Session(DispatcherManager dispatcherManager, SocketChannel channel, Object attachment, EventAdaptor eventAdaptor)
public String id()
public void close()
throws IOException
IOExceptionpublic 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 DispatcherManager dispatcherManager()
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 EventAdaptor getEventAdaptor()
Copyright © 2015. All rights reserved.