| | |
| | | package com.xcong.excoin.modules.gateApi; |
| | | |
| | | import com.xcong.excoin.modules.okxNewPrice.OkxWebSocketClientManager; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.support.ClassPathXmlApplicationContext; |
| | | |
| | | /** |
| | | * Gate 网格交易的独立测试入口(main 方法)。 |
| | | * 通过 Spring XML 上下文初始化管理器,运行一段时间后手动关闭。 |
| | | * |
| | | * @author Administrator |
| | | */ |
| | | public class GateWebSocketClientMain { |
| | | public static void main(String[] args) throws InterruptedException { |
| | | // 使用Spring上下文初始化管理器 |
| | | ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml"); |
| | | GateWebSocketClientManager manager = context.getBean(GateWebSocketClientManager.class); |
| | | |
| | | // 运行一段时间以观察结果 |
| | | Thread.sleep(1200000000L); // 运行一小时 |
| | | Thread.sleep(1200000000L); |
| | | |
| | | // 关闭连接 |
| | | manager.destroy(); |
| | | } |
| | | } |