mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-13 14:16:22 +00:00
perf[net]: increase the number of concurrent server sessions
This commit is contained in:
1 parent
45089373fb
commit
9f599ea878
1 file changed
+6
-3
@@ -30,15 +30,18 @@ public class SessionManager implements ISessionManager {
|
||||
private static final AtomicInteger CLIENT_ATOMIC = new AtomicInteger(0);
|
||||
|
||||
/**
|
||||
* 作为服务器,被别的客户端连接的Session
|
||||
* EN: As a server, the Session is connected by other clients
|
||||
* CN: 作为服务器,被别的客户端连接的Session
|
||||
* <p>
|
||||
* 如:自己作为网关,那肯定有一大堆客户端连接,他们连接上来后,就会保存下来这些信息。
|
||||
* 因此:要全局消息广播,其实要用这个Map
|
||||
*/
|
||||
private final ConcurrentHashMapLongObject<Session> serverSessionMap = new ConcurrentHashMapLongObject<>(64);
|
||||
private final ConcurrentHashMapLongObject<Session> serverSessionMap = new ConcurrentHashMapLongObject<>(128);
|
||||
|
||||
|
||||
/**
|
||||
* 作为客户端,连接别的服务器上后,保存下来的Session
|
||||
* EN: As a client, connect to another server and save Sessions
|
||||
* CN: 作为客户端,连接别的服务器上后,保存下来的Session
|
||||
* 如:自己配置了Consumer,说明自己作为消费者将要消费远程接口,就会创建一个TcpClient去连接Provider,那么连接上后,就会保存下来到这个Map中
|
||||
*/
|
||||
private final ConcurrentHashMapLongObject<Session> clientSessionMap = new ConcurrentHashMapLongObject<>(8);
|
||||
|
||||
Reference in new issue
Block a user