Show More
@@ -541,7 +541,8 b' class unixforkingservice(object):' | |||
|
541 | 541 | exiting = False |
|
542 | 542 | h = self._servicehandler |
|
543 | 543 | selector = selectors.DefaultSelector() |
|
544 |
selector.register(self._sock, selectors.EVENT_READ |
|
|
544 | selector.register(self._sock, selectors.EVENT_READ, | |
|
545 | self._acceptnewconnection) | |
|
545 | 546 | while True: |
|
546 | 547 | if not exiting and h.shouldexit(): |
|
547 | 548 | # clients can no longer connect() to the domain socket, so |
@@ -552,20 +553,21 b' class unixforkingservice(object):' | |||
|
552 | 553 | self._unlinksocket() |
|
553 | 554 | exiting = True |
|
554 | 555 | try: |
|
555 |
|
|
|
556 | events = selector.select(timeout=h.pollinterval) | |
|
556 | 557 | except OSError as inst: |
|
557 | 558 | # selectors2 raises ETIMEDOUT if timeout exceeded while |
|
558 | 559 | # handling signal interrupt. That's probably wrong, but |
|
559 | 560 | # we can easily get around it. |
|
560 | 561 | if inst.errno != errno.ETIMEDOUT: |
|
561 | 562 | raise |
|
562 |
|
|
|
563 |
if not |
|
|
563 | events = [] | |
|
564 | if not events: | |
|
564 | 565 | # only exit if we completed all queued requests |
|
565 | 566 | if exiting: |
|
566 | 567 | break |
|
567 | 568 | continue |
|
568 | self._acceptnewconnection(self._sock, selector) | |
|
569 | for key, _mask in events: | |
|
570 | key.data(key.fileobj, selector) | |
|
569 | 571 | selector.close() |
|
570 | 572 | |
|
571 | 573 | def _acceptnewconnection(self, sock, selector): |
General Comments 0
You need to be logged in to leave comments.
Login now