From 02edb869c249a729167ec5c1a6b003bc9080386c Mon Sep 17 00:00:00 2001 From: msincenselee Date: Sun, 30 Sep 2018 09:55:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0cPickle=3D>pickle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/rpc/vnrpc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vnpy/rpc/vnrpc.py b/vnpy/rpc/vnrpc.py index ca338ede..cda88e7f 100644 --- a/vnpy/rpc/vnrpc.py +++ b/vnpy/rpc/vnrpc.py @@ -8,7 +8,7 @@ import zmq from msgpack import packb, unpackb from json import dumps, loads -import cPickle +import pickle as cPickle pDumps = cPickle.dumps pLoads = cPickle.loads @@ -128,7 +128,7 @@ class RpcServer(RpcObject): # 工作线程相关 self.__active = False # 服务器的工作状态 self.__thread = threading.Thread(target=self.run) # 服务器的工作线程 - + #---------------------------------------------------------------------- def start(self): """启动服务器""" @@ -307,7 +307,7 @@ class RpcClient(RpcObject): topic = '' else: topic = topic.encode('utf-8') - self.__socketSUB.setsockopt(zmq.SUBSCRIBE, topic) + self.__socketSUB.setsockopt_string(zmq.SUBSCRIBE, topic) ########################################################################