| | |
| | | |
| | | EthFilter filter = getFilter(startBlock, startBlock, chain.getContractAddress()); |
| | | Flowable<EthUsdtContract.TransferEventResponse> eventFlowable = ethUsdtContract.transferEventFlowable(filter); |
| | | while (!webSocketClient.getReadyState().equals(ReadyState.OPEN)) { |
| | | log.info("连接中···请稍后"); |
| | | int retries = 3; |
| | | while (retries-- > 0) { |
| | | try { |
| | | Thread.sleep(1000); |
| | | wssContractEventListener2(startBlock, event, type); |
| | | return; |
| | | } catch (Exception ex) { |
| | | log.error("币安监听异常", ex); |
| | | } |
| | | } |
| | | return; |
| | | } |
| | | // 判断websocket是否连接成功 |
| | | if (!webSocketClient.isOpen()) { |
| | | log.error("WebSocket连接失败"); |