Start the HTTP server at the given host and port. Requires calling ``.poll()`` in a while loop to handle incoming requests. :param str host: host name or IP address :param int port: port
(self, host: str = "0.0.0.0", port: int = 5000)
| 289 | return sock |
| 290 | |
| 291 | def start(self, host: str = "0.0.0.0", port: int = 5000) -> None: |
| 292 | """ |
| 293 | Start the HTTP server at the given host and port. Requires calling |
| 294 | ``.poll()`` in a while loop to handle incoming requests. |
| 295 | |
| 296 | :param str host: host name or IP address |
| 297 | :param int port: port |
| 298 | """ |
| 299 | self._verify_can_start(host, port) |
| 300 | |
| 301 | self.host, self.port = host, port |
| 302 | |
| 303 | self.stopped = False |
| 304 | self._sock = self._create_server_socket(self._socket_source, self._ssl_context, host, port) |
| 305 | |
| 306 | if self.debug: |
| 307 | _debug_started_server(self) |
| 308 | |
| 309 | def stop(self) -> None: |
| 310 | """ |
no test coverage detected