From f30fce70bda45c1d07bf5bcc365a426146a76980 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Wed, 22 May 2019 15:18:32 +0800 Subject: [PATCH] [Add] relogin after disconnected --- vnpy/gateway/xtp/xtp_gateway.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vnpy/gateway/xtp/xtp_gateway.py b/vnpy/gateway/xtp/xtp_gateway.py index fbaff25b..9a66f309 100644 --- a/vnpy/gateway/xtp/xtp_gateway.py +++ b/vnpy/gateway/xtp/xtp_gateway.py @@ -306,6 +306,8 @@ class XtpQuoteApi(API.QuoteSpi): """""" self.gateway.write_log("行情服务器连接断开") + self.login() + def OnError(self, error_info: XTPRspInfoStruct) -> Any: """""" self.check_error("行情接口", error_info) @@ -641,6 +643,8 @@ class XtpTraderApi(API.TraderSpi): """""" self.gateway.write_log("交易服务器连接断开") + self.login() + def OnError(self, error_info: XTPRspInfoStruct) -> Any: """""" self.check_error("交易接口", error_info)