| | |
| | | */ |
| | | @Slf4j |
| | | public class OkxQuantWebSocketClient { |
| | | private final WangGeService wangGeService; |
| | | private final CaoZuoService caoZuoService; |
| | | private final RedisUtils redisUtils; |
| | | private final ExchangeInfoEnum account; |
| | | |
| | |
| | | private final AtomicBoolean isConnected = new AtomicBoolean(false); |
| | | private final AtomicBoolean isConnecting = new AtomicBoolean(false); |
| | | |
| | | public OkxQuantWebSocketClient(ExchangeInfoEnum account, WangGeService wangGeService, |
| | | CaoZuoService caoZuoService, RedisUtils redisUtils) { |
| | | /** |
| | | * 获取WebSocketClient实例 |
| | | * @return WebSocketClient实例 |
| | | */ |
| | | public WebSocketClient getWebSocketClient() { |
| | | return webSocketClient; |
| | | } |
| | | |
| | | public OkxQuantWebSocketClient(ExchangeInfoEnum account, |
| | | RedisUtils redisUtils) { |
| | | this.account = account; |
| | | this.wangGeService = wangGeService; |
| | | this.caoZuoService = caoZuoService; |
| | | this.redisUtils = redisUtils; |
| | | } |
| | | |
| | |
| | | |
| | | try { |
| | | InstrumentsWs.handleEvent(account.name()); |
| | | wangGeService.initWangGe(); |
| | | SSLConfig.configureSSL(); |
| | | System.setProperty("https.protocols", "TLSv1.2,TLSv1.3"); |
| | | String WS_URL = WS_URL_MONIPAN; |