From c50c31a6bd392bfe8c886834a4c0aac0b3284296 Mon Sep 17 00:00:00 2001 From: nanoric Date: Mon, 15 Oct 2018 04:37:43 -0400 Subject: [PATCH] =?UTF-8?q?[Mod]=20sendRequest=E6=94=B9=E5=90=8D=E4=B8=BAs?= =?UTF-8?q?endPacket?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 和onPacket对应。 --- tests/api/base/WebSocketClientTest.py | 2 +- vnpy/api/websocket/WebSocketClient.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/api/base/WebSocketClientTest.py b/tests/api/base/WebSocketClientTest.py index 1bf1b923..dc9651dd 100644 --- a/tests/api/base/WebSocketClientTest.py +++ b/tests/api/base/WebSocketClientTest.py @@ -38,7 +38,7 @@ class WebsocketClientTest(unittest.TestCase): req = { 'name': 'val' } - self.c.sendRequest(req) + self.c.sendPacket(req) res = self.c.p.get(3) self.assertEqual(res, req) diff --git a/vnpy/api/websocket/WebSocketClient.py b/vnpy/api/websocket/WebSocketClient.py index 750a593f..9ae7cafb 100644 --- a/vnpy/api/websocket/WebSocketClient.py +++ b/vnpy/api/websocket/WebSocketClient.py @@ -55,7 +55,7 @@ class WebsocketClient(object): self._disconnect() #---------------------------------------------------------------------- - def sendRequest(self, dictObj): # type: (dict)->None + def sendPacket(self, dictObj): # type: (dict)->None """发出请求:相当于sendText(json.dumps(dictObj))""" return self._get_ws().send(json.dumps(dictObj), opcode=websocket.ABNF.OPCODE_TEXT)