[Mod] WebSocketClient.onMessage改名为onPacket,以免和正常WebSocket的onMessage搞混。
This commit is contained in:
parent
66cb55ef26
commit
a55246eb77
@ -13,7 +13,7 @@ class TestWebsocketClient(WebsocketClient):
|
||||
self.init(host)
|
||||
self.p = Promise()
|
||||
|
||||
def onMessage(self, packet):
|
||||
def onPacket(self, packet):
|
||||
self.p.set_result(packet)
|
||||
pass
|
||||
|
||||
|
@ -109,7 +109,7 @@ class WebsocketClient(object):
|
||||
continue
|
||||
|
||||
data = json.loads(stream)
|
||||
self.onMessage(data)
|
||||
self.onPacket(data)
|
||||
except:
|
||||
et, ev, tb = sys.exc_info()
|
||||
self.onError(et, ev, tb)
|
||||
@ -135,7 +135,7 @@ class WebsocketClient(object):
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
@abstractmethod
|
||||
def onMessage(self, packet):
|
||||
def onPacket(self, packet):
|
||||
"""
|
||||
数据回调。
|
||||
只有在数据为json包的时候才会触发这个回调
|
||||
|
Loading…
Reference in New Issue
Block a user