Interface SessionManager
- All Superinterfaces:
Manager
- All Known Implementing Classes:
SessionManagerImpl
The session manager.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDatagramForSession
(DatagramChannel datagramChannel, SocketAddress remoteAddress, Session session) createSocketSession
(SocketChannel socketChannel, SelectionKey selectionKey) createWebSocketSession
(io.netty.channel.Channel webSocketChannel) void
emitEvent
(ServerEvent event, Object... params) getSessionByDatagram
(SocketAddress remoteAddress) getSessionBySocket
(SocketChannel socketChannel) getSessionByWebSocket
(io.netty.channel.Channel webSocketChannel) int
void
removeSession
(Session session) Remove session from its manager, this method should not be called.void
removeSessionBySocket
(SocketChannel socketChannel) void
removeSessionByWebSocket
(io.netty.channel.Channel webSocketChannel) void
setPacketQueuePolicy
(Class<? extends PacketQueuePolicy> clazz) void
setPacketQueueSize
(int queueSize)
-
Method Details
-
createSocketSession
-
removeSessionBySocket
- Throws:
NullPointerException
-
getSessionBySocket
-
createWebSocketSession
-
removeSessionByWebSocket
void removeSessionByWebSocket(io.netty.channel.Channel webSocketChannel) throws NullPointerException - Throws:
NullPointerException
-
getSessionByWebSocket
-
addDatagramForSession
void addDatagramForSession(DatagramChannel datagramChannel, SocketAddress remoteAddress, Session session) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
getSessionByDatagram
-
emitEvent
-
setPacketQueuePolicy
void setPacketQueuePolicy(Class<? extends PacketQueuePolicy> clazz) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException -
setPacketQueueSize
void setPacketQueueSize(int queueSize) -
removeSession
Remove session from its manager, this method should not be called. Call instead the methodSession.close(ConnectionDisconnectMode, PlayerDisconnectMode)
to completely eliminate the session.- Parameters:
session
- the removing session
-
getSessionCount
int getSessionCount()
-