public abstract class EzyAbstractSession extends com.tvd12.ezyfox.entity.EzyEntity implements EzySession, EzyDisconnectReasonAware, EzyDatagramChannelAware, EzyUdpClientAddressAware, EzyImmediateDeliverAware, EzyDroppedPacketsAware, EzyDatagramChannelPoolAware
| Constructor and Description |
|---|
EzyAbstractSession() |
| Modifier and Type | Method and Description |
|---|---|
void |
addReadBytes(long bytes)
Add read bytes.
|
void |
addReadRequests(int requests)
add read requests.
|
boolean |
addReceivedRequests(int requests)
add received requests.
|
void |
addWrittenBytes(long bytes)
Add written bytes.
|
void |
addWrittenResponses(int responses)
add written responses.
|
void |
close()
close this session.
|
void |
destroy() |
void |
disconnect(com.tvd12.ezyfox.constant.EzyConstant disconnectReason)
disconnect this session.
|
boolean |
equals(Object obj) |
SocketAddress |
getClientAddress()
Get client full ip address.
|
<T> T |
getConnection()
Get connection.
|
String |
getName() |
SocketAddress |
getServerAddress()
Get server full ip address.
|
int |
hashCode() |
boolean |
isIdle()
The session is idle or not.
|
void |
send(EzyPacket packet) |
void |
sendNow(EzyPacket packet) |
void |
setActivated(boolean value)
Set activated value.
|
void |
setOwner(EzyUser owner) |
String |
toString() |
containsKey, getProperties, getProperty, getProperty, removeProperty, setProperties, setPropertyclone, finalize, getClass, notify, notifyAll, wait, wait, waitdisconnect, getBeforeToken, getChannel, getClientId, getClientKey, getClientType, getClientVersion, getConnectionType, getCreationTime, getDatagramChannel, getDatagramChannelPool, getDisconnectReason, getExtensionRequestQueue, getId, getLastActivityTime, getLastReadTime, getLastWriteTime, getLoggedInTime, getMaxIdleTime, getMaxWaitingTime, getOwnerName, getPacketQueue, getPrivateKey, getPublicKey, getReadBytes, getReadRequests, getSessionKey, getSystemRequestQueue, getToken, getUdpClientAddress, getWrittenBytes, getWrittenResponses, isActivated, isDestroyed, isLoggedIn, isStreamingEnable, setChannel, setClientId, setClientKey, setClientType, setClientVersion, setCreationTime, setLastActivityTime, setLastReadTime, setLastWriteTime, setLoggedIn, setLoggedInTime, setMaxIdleTime, setMaxWaitingTime, setPrivateKey, setPublicKey, setSessionKey, setTokenremoveProperty, setProperties, setPropertycontainsKey, getProperties, getProperty, getProperty, getPropertysetDisconnectReasonsetDatagramChannelsetUdpClientAddresssetImmediateDeliversetDroppedPacketssetDatagramChannelPoolprotected long id
protected String name
protected String clientId
protected String ownerName
protected long creationTime
protected long lastReadTime
protected long lastWriteTime
protected long readBytes
protected long writtenBytes
protected long lastActivityTime
protected long loggedInTime
protected int readRequests
protected int writtenResponses
protected byte[] privateKey
protected byte[] publicKey
protected byte[] clientKey
protected byte[] sessionKey
protected volatile boolean loggedIn
protected volatile boolean activated
protected volatile boolean destroyed
protected volatile boolean streamingEnable
protected String token
protected String clientType
protected String clientVersion
protected String beforeToken
protected com.tvd12.ezyfox.constant.EzyConstant connectionType
protected com.tvd12.ezyfox.constant.EzyConstant disconnectReason
protected SocketAddress udpClientAddress
protected DatagramChannel datagramChannel
protected EzyDatagramChannelPool datagramChannelPool
protected long maxWaitingTime
protected long maxIdleTime
protected EzyChannel channel
protected EzyDroppedPackets droppedPackets
protected EzyImmediateDeliver immediateDeliver
protected EzySessionTicketsQueue sessionTicketsQueue
protected EzySocketDisconnectionQueue disconnectionQueue
protected EzyPacketQueue packetQueue
protected EzyRequestQueue systemRequestQueue
protected EzyRequestQueue extensionRequestQueue
protected EzyRequestFrame requestFrameInSecond
protected transient EzySessionDelegate delegate
protected volatile boolean disconnectionRegistered
protected final Object disconnectionLock
public void setOwner(EzyUser owner)
public void addReadBytes(long bytes)
EzySessionaddReadBytes in interface EzySessionbytes - the read bytespublic void addWrittenBytes(long bytes)
EzySessionaddWrittenBytes in interface EzySessionbytes - the written bytespublic void addReadRequests(int requests)
EzySessionaddReadRequests in interface EzySessionrequests - number of read requestspublic boolean addReceivedRequests(int requests)
EzySessionaddReceivedRequests in interface EzySessionrequests - number of received requestspublic void addWrittenResponses(int responses)
EzySessionaddWrittenResponses in interface EzySessionresponses - number of responsespublic void setActivated(boolean value)
EzySessionsetActivated in interface EzySessionvalue - session is active or notpublic boolean isIdle()
EzySessionisIdle in interface EzySessionpublic final void send(EzyPacket packet)
send in interface EzyDeliverpublic void sendNow(EzyPacket packet)
sendNow in interface EzyDeliverpublic void disconnect(com.tvd12.ezyfox.constant.EzyConstant disconnectReason)
EzySessiondisconnect in interface EzySessiondisconnectReason - the reasonpublic void close()
EzySessionclose in interface EzySessionpublic <T> T getConnection()
EzySessiongetConnection in interface EzySessionT - the connection typepublic SocketAddress getServerAddress()
EzySessiongetServerAddress in interface EzySessionpublic SocketAddress getClientAddress()
EzySessiongetClientAddress in interface EzySessionpublic String getName()
getName in interface com.tvd12.ezyfox.constant.EzyHasNamepublic void destroy()
destroy in interface com.tvd12.ezyfox.util.EzyDestroyableCopyright © 2024 Young Monkeys. All rights reserved.