| | |
| | | package com.whyc.webSocket; |
| | | |
| | | import com.whyc.config.WebSocketConfig; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.factory.ThreadPoolExecutorFactory; |
| | | import com.whyc.pojo.Battinf; |
| | |
| | | * 运维分配-班组管理 |
| | | */ |
| | | @Component |
| | | @ServerEndpoint(value = "/groupStation",encoders = WebSocketEncoder.class) |
| | | @ServerEndpoint(value = "/groupStation",encoders = WebSocketEncoder.class,configurator = WebSocketConfig.class) |
| | | public class GroupStationSocket { |
| | | private volatile Thread thread; |
| | | |
| | |
| | | while (!currentThread().isInterrupted()) { |
| | | Response groupWithStationAndAlarm = baoJiGroupService.getGroupWithStationAndAlarm(userId); |
| | | session.getBasicRemote().sendObject(groupWithStationAndAlarm); |
| | | sleep(4000); |
| | | sleep(10000); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |