use of com.tvd12.ezyfoxserver.socket.EzyChannel in project ezyfox-server by youngmonkeys.
the class EzyHandlerGroupManagerImpl method newHandlerGroup.
@SuppressWarnings("unchecked")
@Override
public <T extends EzyHandlerGroup> T newHandlerGroup(EzyChannel channel, EzyConnectionType type) {
EzyHandlerGroup group = handlerGroupBuilderFactory.newBuilder(channel, type).build();
groupsByConnection.put(channel.getConnection(), group);
return (T) group;
}
use of com.tvd12.ezyfoxserver.socket.EzyChannel in project ezyfox-server by youngmonkeys.
the class EzyHandlerGroupManagerImpl method getHandlerGroup.
private EzyHandlerGroup getHandlerGroup(EzySession session) {
if (session == null) {
return null;
}
EzyChannel channel = session.getChannel();
if (channel == null) {
return null;
}
Object connection = channel.getConnection();
if (connection == null) {
return null;
}
return groupsByConnection.get(connection);
}
use of com.tvd12.ezyfoxserver.socket.EzyChannel in project ezyfox-server by youngmonkeys.
the class EzyHandlerGroupManagerImpl method removeHandlerGroup.
@Override
public EzySocketDataHandlerGroup removeHandlerGroup(EzySession session) {
if (session == null) {
return null;
}
EzyChannel channel = session.getChannel();
if (channel == null) {
return null;
}
Object connection = channel.getConnection();
if (connection == null) {
return null;
}
EzyHandlerGroup group = groupsByConnection.remove(connection);
SocketAddress udpClientAddress = session.getUdpClientAddress();
if (udpClientAddress != null) {
socketChannelByUdpAddress.remove(udpClientAddress);
}
logger.debug("remove handler group: {} with session: {}, " + "groupsByConnection.size: {}, socketChannelByUdpAddress.size: {}", group, session, groupsByConnection.size(), socketChannelByUdpAddress.size());
return group;
}
Aggregations