6969
7070HB_PING_TIME = 10
7171HB_PONG_TIME = 10
72- POLL_TIME_BLOCKING = 5.0
73- POLL_TIME_NON_BLOCKING = 0.01
7472TIMEOUT_TIME = 30.0
7573RETRY_TIME = 5.0
7674
@@ -530,7 +528,7 @@ def run(self) -> None:
530528 self .logger .debug ("Thread started..." )
531529 while not self .stop .is_set ():
532530 try :
533- if self ._run_once (timeout = POLL_TIME_BLOCKING ) == 1 :
531+ if self ._run_once () == 1 :
534532 break
535533 except Exception : # pylint: disable=broad-except
536534 self ._force_recon = True
@@ -545,7 +543,7 @@ def run(self) -> None:
545543 # Clean up
546544 self ._cleanup ()
547545
548- def _run_once (self , timeout : float = POLL_TIME_NON_BLOCKING ) -> int :
546+ def _run_once (self ) -> int :
549547 """Receive from the socket and handle data."""
550548 # pylint: disable=too-many-branches, too-many-statements, too-many-return-statements
551549
@@ -569,10 +567,10 @@ def _run_once(self, timeout: float = POLL_TIME_NON_BLOCKING) -> int:
569567 poll_obj = select .poll ()
570568 for poll_fd in rlist :
571569 poll_obj .register (poll_fd , select .POLLIN )
572- poll_result = poll_obj .poll (timeout * 1000 ) # timeout in milliseconds
570+ poll_result = poll_obj .poll ()
573571 can_read = [fd_to_socket [fd ] for fd , _status in poll_result ]
574572 else :
575- can_read , _ , _ = select .select (rlist , [], [], timeout )
573+ can_read , _ , _ = select .select (rlist , [], [], None )
576574 except (ValueError , OSError ) as exc :
577575 self .logger .error (
578576 "[%s(%s):%s] Error in select call: %s" ,
0 commit comments