|
@@ -90,26 +90,24 @@ public class WebSocketOeServer implements Concurrently {
|
|
|
redisUtil = SpringContextHolder.getBean(RedisUtil.class);
|
|
|
|
|
|
TBSession tbSession = AuthUtil.websocketAuthInterceptor(Platform.valueOf(platform), deviceId, authorization, String.valueOf(mapParameter.get("time").get(0)), SystemConstant.GET, url);
|
|
|
- Boolean check = WebsocketUtil.checkExamStatus(this.recordId);
|
|
|
- if (check) {
|
|
|
- this.session = session;
|
|
|
- session.setMaxIdleTimeout(SystemConstant.WEBSOCKET_MAX_TIME_OUT);
|
|
|
- this.sessionId = tbSession.getId();
|
|
|
- if (webSocketMap.containsKey(this.session.getId())) {
|
|
|
- webSocketMap.remove(this.session.getId());
|
|
|
- webSocketMap.put(this.session.getId(), this);
|
|
|
- } else {
|
|
|
- webSocketMap.put(this.session.getId(), this);
|
|
|
- addOnlineCount();
|
|
|
- }
|
|
|
- log.info("用户连接:{},当前在线人数为:{}", this.sessionId, getOnlineCount());
|
|
|
- InetSocketAddress addr = (InetSocketAddress) WebsocketUtil.getFieldInstance(this.session.getAsyncRemote(), "base#socketWrapper#socket#sc#remoteAddress");
|
|
|
- this.ip = addr.toString().replace("/", "").split(":")[0];
|
|
|
- log.info("ip[:{}]连接成功", this.ip);
|
|
|
- WebsocketUtil.updateExamRecordWebsocketStatus(recordId, ip, this.session.getId(), WebsocketStatusEnum.ON_LINE);
|
|
|
- this.updateTime = System.currentTimeMillis();
|
|
|
- tranMap = WebsocketUtil.initWebsocket(recordId, null, deviceId, ip, updateTime);
|
|
|
+ WebsocketUtil.checkExamStatus(this.recordId);
|
|
|
+ this.session = session;
|
|
|
+ session.setMaxIdleTimeout(SystemConstant.WEBSOCKET_MAX_TIME_OUT);
|
|
|
+ this.sessionId = tbSession.getId();
|
|
|
+ if (webSocketMap.containsKey(this.session.getId())) {
|
|
|
+ webSocketMap.remove(this.session.getId());
|
|
|
+ webSocketMap.put(this.session.getId(), this);
|
|
|
+ } else {
|
|
|
+ webSocketMap.put(this.session.getId(), this);
|
|
|
+ addOnlineCount();
|
|
|
}
|
|
|
+ log.info("用户连接:{},当前在线人数为:{}", this.sessionId, getOnlineCount());
|
|
|
+ InetSocketAddress addr = (InetSocketAddress) WebsocketUtil.getFieldInstance(this.session.getAsyncRemote(), "base#socketWrapper#socket#sc#remoteAddress");
|
|
|
+ this.ip = addr.toString().replace("/", "").split(":")[0];
|
|
|
+ log.info("ip[:{}]连接成功", this.ip);
|
|
|
+ WebsocketUtil.updateExamRecordWebsocketStatus(recordId, ip, this.session.getId(), WebsocketStatusEnum.ON_LINE);
|
|
|
+ this.updateTime = System.currentTimeMillis();
|
|
|
+ tranMap = WebsocketUtil.initWebsocket(recordId, null, deviceId, ip, updateTime);
|
|
|
}
|
|
|
|
|
|
/**
|