Closes the connection. Returns a `.Future` that resolves after the serving loop has exited.
(self)
| 790 | self._serving_future = None # type: Optional[Future[None]] |
| 791 | |
| 792 | async def close(self) -> None: |
| 793 | """Closes the connection. |
| 794 | |
| 795 | Returns a `.Future` that resolves after the serving loop has exited. |
| 796 | """ |
| 797 | self.stream.close() |
| 798 | # Block until the serving loop is done, but ignore any exceptions |
| 799 | # (start_serving is already responsible for logging them). |
| 800 | assert self._serving_future is not None |
| 801 | try: |
| 802 | await self._serving_future |
| 803 | except Exception: |
| 804 | pass |
| 805 | |
| 806 | def start_serving(self, delegate: httputil.HTTPServerConnectionDelegate) -> None: |
| 807 | """Starts serving requests on this connection. |