MCPcopy Create free account
hub / github.com/adafruit/Adafruit_CircuitPython_HTTPServer / stop

Method stop

adafruit_httpserver/server.py:309–321  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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."""

Callers 1

serve_foreverMethod · 0.95

Calls 2

_debug_stopped_serverFunction · 0.85
closeMethod · 0.45

Tested by

no test coverage detected