class_docstr: A very basic web server.
class_docstr_tok: ["A","very","basic","web","server","."]
docstr: Stops the server.
docstr_tok: ["Stops","the","server","."]
code: def stop(self) -> None:
      """Stops the server."""
      self.stop_serving = True
      try:
          # This is to force stop the server loop
          urlopen(f"http://{self.host}:{self.port}")
      except OSError:
          pass
      log.info("Shutting down the webserver")
      self.thread.join()
  
file_path: bokeh/tests/support/plugins/file_server.py
imports: from __future__ import annotations
  import logging
  import os
  import threading
  from http.server import BaseHTTPRequestHandler, HTTPServer
  from pathlib import Path
  from typing import Any
  from urllib.request import urlopen
  import pytest
label_desc: Use image node_id 4 for calling the SimpleWebServer obj's underlying member method code with example usage: obj.stop() without return types