Package one.nio.net
Class Session
java.lang.Object
one.nio.net.Session
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
HttpSession,RpcSession
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprotected booleanstatic final intstatic final intprotected intprotected intstatic final intprotected longprotected static final org.slf4j.Loggerprotected Session.QueueItemstatic final intprotected Selectorprotected intprotected Socketstatic final intstatic final intprotected booleanstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcheckStatus(long currentTime, long keepAlive) voidclose()voidgetQueueStats(long[] stats) final StringvoidbooleanisSsl()final longvoidlisten(int newEventsToListen) voidprocess(byte[] buffer) protected voidprocessRead(byte[] buffer) protected voidintread(byte[] data, int offset, int count) intreadRaw(long address, int count) voidfinal Socketsocket()final voidwrite(byte[] data, int offset, int count) final voidwrite(byte[] data, int offset, int count, int flags) final voidwrite(Session.QueueItem item)
-
Field Details
-
log
protected static final org.slf4j.Logger log -
READABLE
public static final int READABLE- See Also:
-
WRITEABLE
public static final int WRITEABLE- See Also:
-
CLOSING
public static final int CLOSING- See Also:
-
EVENT_MASK
public static final int EVENT_MASK- See Also:
-
SSL
public static final int SSL- See Also:
-
ACTIVE
public static final int ACTIVE- See Also:
-
IDLE
public static final int IDLE- See Also:
-
STALE
public static final int STALE- See Also:
-
socket
-
selector
-
slot
protected int slot -
events
protected int events -
eventsToListen
protected int eventsToListen -
wasSelected
protected boolean wasSelected -
closing
protected boolean closing -
queueHead
-
lastAccessTime
protected volatile long lastAccessTime
-
-
Constructor Details
-
Session
-
Session
-
-
Method Details
-
getRemoteHost
-
socket
-
lastAccessTime
public final long lastAccessTime() -
isSsl
public boolean isSsl() -
checkStatus
public int checkStatus(long currentTime, long keepAlive) -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
scheduleClose
public void scheduleClose() -
getQueueStats
public void getQueueStats(long[] stats) -
listen
public void listen(int newEventsToListen) -
read
- Throws:
IOException
-
readRaw
- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
processRead
- Throws:
Exception
-
processWrite
- Throws:
Exception
-
process
- Throws:
Exception
-
handleException
-