| | |
| | | private static final String WS_URL_MONIPAN = "wss://wspap.okx.com:8443/ws/v5/public"; |
| | | private static final String WS_URL_SHIPAN = "wss://ws.okx.com:8443/ws/v5/public"; |
| | | private static final boolean isAccountType = true; |
| | | // private static final boolean isAccountType = false; |
| | | |
| | | /** |
| | | * 建立与 OKX WebSocket 服务器的连接。 |
| | |
| | | private void sendPing() { |
| | | try { |
| | | if (webSocketClient != null && webSocketClient.isOpen()) { |
| | | JSONObject ping = new JSONObject(); |
| | | ping.put("op", "ping"); |
| | | webSocketClient.send(ping.toJSONString()); |
| | | webSocketClient.send("ping"); |
| | | log.debug("发送ping请求"); |
| | | } |
| | | } catch (Exception e) { |