code: def select_sockets(self, timeout=None):
          
          if timeout is not None:
              t = time.time()
          while True:
              try:
                  ready, __, __ = select.select(self.sockets(), (), (), timeout)
              except ValueError:
                  # there's fd=0 socket.
                  pass
              except select.error as exc:
                  # ignore an interrupted system call.
                  if exc.args[0] != EINTR:
                      raise
              else:
                  # succeeded.
                  return ready
              # retry.
              if timeout is None:
                  continue
              # decrease timeout.
              t2 = time.time()
              timeout -= t2 - t
              t = t2
              if timeout <= 0:
                  # timed out.
                  return []
docs: EINTR safe version of `select`.  It focuses on just incoming
          sockets.