Commit f5560199 by 段启岩

消息更新

parent b1726f6e
...@@ -83,9 +83,10 @@ public class SocketIOServiceImpl implements SocketIOService { ...@@ -83,9 +83,10 @@ public class SocketIOServiceImpl implements SocketIOService {
return; return;
} }
// 将session存入内存 // 将session存入内存
putClient(userId, client); putClient(userId, client);
log.info("user {} connected to the im server", userId); log.info("user {} [{},{},{}] connected to the im server", userId, client.getSessionId(), client.getRemoteAddress(), client.getNamespace());
// client.sendEvent(PUSH_EVENT, "hello, 欢迎连接服务器!"); // client.sendEvent(PUSH_EVENT, "hello, 欢迎连接服务器!");
}); });
...@@ -126,7 +127,6 @@ public class SocketIOServiceImpl implements SocketIOService { ...@@ -126,7 +127,6 @@ public class SocketIOServiceImpl implements SocketIOService {
Set<SocketIOClient> clients = CLIENT_MAP.get(userId); Set<SocketIOClient> clients = CLIENT_MAP.get(userId);
log.info("send message to {}", userId); log.info("send message to {}", userId);
if (!CollectionUtils.isEmpty(clients)) { if (!CollectionUtils.isEmpty(clients)) {
log.info("send {}", clients);
clients.forEach(socketIOClient -> { clients.forEach(socketIOClient -> {
socketIOClient.sendEvent(PUSH_EVENT, message); socketIOClient.sendEvent(PUSH_EVENT, message);
});; });;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment