From 9e71df1ebdb8f062f2e0c4968a8a81296fd17daf Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Thu, 8 Mar 2018 09:35:25 +0800 Subject: [PATCH] =?UTF-8?q?[Mod]=E4=BF=AE=E6=94=B9MainEngineProxy=E7=9A=84?= =?UTF-8?q?exit=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/WebTrader/run.py | 4 +--- vnpy/rpc/vnrpc.py | 3 +-- vnpy/trader/app/rpcService/rsClient.py | 3 ++- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/examples/WebTrader/run.py b/examples/WebTrader/run.py index 8ea79db6..e2e639f5 100644 --- a/examples/WebTrader/run.py +++ b/examples/WebTrader/run.py @@ -99,10 +99,8 @@ class Gateway(Resource): """查询""" args = self.parser.parse_args() token = args['token'] - print token - print TOKEN + if token != TOKEN: - print 'token error' return {'result_code':'error','message':'token error'} l = me.getAllGatewayDetails() diff --git a/vnpy/rpc/vnrpc.py b/vnpy/rpc/vnrpc.py index f8c00047..cc6d7275 100644 --- a/vnpy/rpc/vnrpc.py +++ b/vnpy/rpc/vnrpc.py @@ -298,8 +298,7 @@ class RpcClient(RpcObject): 注意topic必须是ascii编码 """ self.__socketSUB.setsockopt(zmq.SUBSCRIBE, topic) - - + ######################################################################## class RemoteException(Exception): diff --git a/vnpy/trader/app/rpcService/rsClient.py b/vnpy/trader/app/rpcService/rsClient.py index d674c76c..8d45f63f 100644 --- a/vnpy/trader/app/rpcService/rsClient.py +++ b/vnpy/trader/app/rpcService/rsClient.py @@ -107,6 +107,7 @@ class MainEngineProxy(object): #---------------------------------------------------------------------- def exit(self): - self.eventEvent.stop() + self.eventEngine.stop() + if self.client: self.client.stop()