Stops the server from listening for new connections and closes the socket. Current requests will be processed. Server can be started again by calling ``.start()`` or ``.serve_forever()``.
(self)
| 307 | _debug_started_server(self) |
| 308 | |
| 309 | def stop(self) -> None: |
| 310 | """ |
| 311 | Stops the server from listening for new connections and closes the socket. |
| 312 | Current requests will be processed. Server can be started again by calling ``.start()`` |
| 313 | or ``.serve_forever()``. |
| 314 | """ |
| 315 | self.host, self.port = None, None |
| 316 | |
| 317 | self.stopped = True |
| 318 | self._sock.close() |
| 319 | |
| 320 | if self.debug: |
| 321 | _debug_stopped_server(self) |
| 322 | |
| 323 | def _receive_header_bytes(self, sock: _ISocket) -> bytes: |
| 324 | """Receive bytes until a empty line is received.""" |
no test coverage detected