(self, started_event)
| 92 | self.loop.close() |
| 93 | |
| 94 | async def _main(self, started_event): |
| 95 | self.listen_task = asyncio.ensure_future(self.listen()) |
| 96 | # Notify the main thread that we are ready to go. |
| 97 | started_event.set() |
| 98 | try: |
| 99 | await self.listen_task |
| 100 | finally: |
| 101 | for c in list(self.connections): |
| 102 | c.close() |
| 103 | await asyncio.sleep(0.01) |
| 104 | if hasattr(self.loop, 'remove_reader'): |
| 105 | self.loop.remove_reader(self.sock.fileno()) |
| 106 | self.sock.close() |
| 107 | |
| 108 | async def listen(self): |
| 109 | while True: |
no test coverage detected