You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the websockets library to implement a client that connects to a websocket server running on another websocket implementation (node.js). All is working fine, except that, when I call websocket.close() on the client side nothing happens.
Here is the code:
async def close_w(self):
print("Handling request to close websocket")
if self.is_connected:
print("Websocket is open. Closing.")
self.websocket.close(1000, 'just because')
print("Close request sent. Waiting for actual close.")
r = await self.websocket.wait_closed()
print("Websocket closed")
print("result", r)
print("Close request handled")
The last message I see printed on screen is "Close request sent. Waiting for actual close.", and then it just waits forever
The text was updated successfully, but these errors were encountered:
I am using the websockets library to implement a client that connects to a websocket server running on another websocket implementation (node.js). All is working fine, except that, when I call websocket.close() on the client side nothing happens.
Here is the code:
async def close_w(self):
print("Handling request to close websocket")
if self.is_connected:
print("Websocket is open. Closing.")
self.websocket.close(1000, 'just because')
print("Close request sent. Waiting for actual close.")
r = await self.websocket.wait_closed()
print("Websocket closed")
print("result", r)
print("Close request handled")
The last message I see printed on screen is "Close request sent. Waiting for actual close.", and then it just waits forever
The text was updated successfully, but these errors were encountered: