Convert timeout to ms when using poll method

This commit is contained in:
Tomasz Spyrka 2022-12-23 23:41:44 +01:00 committed by Yu Liao
parent 0855f76739
commit 5d1e254915

View File

@ -182,6 +182,8 @@ class WSClient:
if hasattr(select, "poll"):
poll = select.poll()
poll.register(self.sock.sock, select.POLLIN)
if timeout is not None:
timeout *= 1_000 # poll method uses milliseconds as the time unit
r = poll.poll(timeout)
poll.unregister(self.sock.sock)
else: