|
@@ -18,7 +18,7 @@ public class WebSocketHandler extends AbstractWebSocketHandler {
|
|
|
|
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(WebSocketHandler.class);
|
|
|
|
|
|
- public static final Map<String, WebSocketSession> clients = new ConcurrentHashMap<>();
|
|
|
+ public static final Map<String, WebSocketSession> WS_CLIENTS = new ConcurrentHashMap<>();
|
|
|
|
|
|
public WebSocketHandler() {
|
|
|
super();
|
|
@@ -28,7 +28,7 @@ public class WebSocketHandler extends AbstractWebSocketHandler {
|
|
|
public void afterConnectionEstablished(WebSocketSession session) throws Exception {
|
|
|
String phone = session.getPrincipal().getName().split(":")[1];
|
|
|
LOGGER.info("{}上线", session.getPrincipal().getName().split(":")[1]);
|
|
|
- clients.put(phone, session);
|
|
|
+ WS_CLIENTS.put(phone, session);
|
|
|
super.afterConnectionEstablished(session);
|
|
|
}
|
|
|
|