69
69
70
70
HB_PING_TIME = 10
71
71
HB_PONG_TIME = 10
72
- POLL_TIME_BLOCKING = 5.0
73
- POLL_TIME_NON_BLOCKING = 0.01
74
72
TIMEOUT_TIME = 30.0
75
73
RETRY_TIME = 5.0
76
74
@@ -530,7 +528,7 @@ def run(self) -> None:
530
528
self .logger .debug ("Thread started..." )
531
529
while not self .stop .is_set ():
532
530
try :
533
- if self ._run_once (timeout = POLL_TIME_BLOCKING ) == 1 :
531
+ if self ._run_once () == 1 :
534
532
break
535
533
except Exception : # pylint: disable=broad-except
536
534
self ._force_recon = True
@@ -545,7 +543,7 @@ def run(self) -> None:
545
543
# Clean up
546
544
self ._cleanup ()
547
545
548
- def _run_once (self , timeout : float = POLL_TIME_NON_BLOCKING ) -> int :
546
+ def _run_once (self ) -> int :
549
547
"""Receive from the socket and handle data."""
550
548
# pylint: disable=too-many-branches, too-many-statements, too-many-return-statements
551
549
@@ -569,10 +567,10 @@ def _run_once(self, timeout: float = POLL_TIME_NON_BLOCKING) -> int:
569
567
poll_obj = select .poll ()
570
568
for poll_fd in rlist :
571
569
poll_obj .register (poll_fd , select .POLLIN )
572
- poll_result = poll_obj .poll (timeout * 1000 ) # timeout in milliseconds
570
+ poll_result = poll_obj .poll ()
573
571
can_read = [fd_to_socket [fd ] for fd , _status in poll_result ]
574
572
else :
575
- can_read , _ , _ = select .select (rlist , [], [], timeout )
573
+ can_read , _ , _ = select .select (rlist , [], [], None )
576
574
except (ValueError , OSError ) as exc :
577
575
self .logger .error (
578
576
"[%s(%s):%s] Error in select call: %s" ,
0 commit comments