houzhongjian
2024-07-23 a6de490948278991e47952e90671ddba4555e9a2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//package com.iailab.module.event.ws;
//
//import java.util.concurrent.ExecutorService;
//import java.util.concurrent.Executors;
//
//public enum ReconnectThreadEnum {
//
//    WebSocketInstance(){
//        @Override
//        public void reconnectWs(EventWebSocketClient demoWebSocketClient) {
//            cachedThreadPool.execute(new Runnable() {
//                @Override
//                public void run() {
//                    try {
//                        //重连间隔一秒
//                        Thread.sleep(10000000);
//                        System.out.println("重新连接");
//                    } catch (InterruptedException e) {
//                        e.printStackTrace();
//                    }
//                    demoWebSocketClient.reconnect();
//                }
//            });
//        }
//    };
//
//    private static final ExecutorService cachedThreadPool = Executors.newCachedThreadPool();
//
//    public abstract void reconnectWs(EventWebSocketClient demoWebSocketClient);
//
//    public static ReconnectThreadEnum getInstance(){
//        return WebSocketInstance;
//    }
//}