Port to the websockets asyncio implementation, support for websockets 13 and 14
This commit is contained in:
@@ -43,7 +43,7 @@ class WebsocketService(ABC):
|
||||
True if connection is verified working, False otherwise.
|
||||
"""
|
||||
try:
|
||||
if not self._websocket or self._websocket.closed:
|
||||
if not self._websocket or self._websocket.state is State.CLOSED:
|
||||
return False
|
||||
await self._websocket.ping()
|
||||
return True
|
||||
@@ -82,7 +82,7 @@ class WebsocketService(ABC):
|
||||
try:
|
||||
await self._receive_messages()
|
||||
retry_count = 0 # Reset counter on successful message receive
|
||||
if self._websocket and self._websocket.state == State.CLOSED:
|
||||
if self._websocket and self._websocket.state is State.CLOSED:
|
||||
raise websockets.ConnectionClosedOK(
|
||||
self._websocket.close_rcvd,
|
||||
self._websocket.close_sent,
|
||||
|
||||
Reference in New Issue
Block a user