Stops listening for new connections. Requests currently in progress may still continue after the server is stopped.
(self)
| 304 | self.add_sockets(sockets) |
| 305 | |
| 306 | def stop(self) -> None: |
| 307 | """Stops listening for new connections. |
| 308 | |
| 309 | Requests currently in progress may still continue after the |
| 310 | server is stopped. |
| 311 | """ |
| 312 | if self._stopped: |
| 313 | return |
| 314 | self._stopped = True |
| 315 | for fd, sock in self._sockets.items(): |
| 316 | assert sock.fileno() == fd |
| 317 | # Unregister socket from IOLoop |
| 318 | self._handlers.pop(fd)() |
| 319 | sock.close() |
| 320 | |
| 321 | def handle_stream( |
| 322 | self, stream: IOStream, address: tuple |