slmsuite.hardware.remote.Server#

class Server(hardware, port=5025, timeout=0.5, allowlist=None)[source]#

Bases: object

Server for handling client commands and interfacing with hardware.

Methods

identify_hardware

listen

Blocking command to listen for client commands and process them once they are given.

__init__(hardware, port=5025, timeout=0.5, allowlist=None)[source]#

Initializes a server to host slmsuite hardware: cameras and SLMs. Interface with this server using RemoteSLM and RemoteCamera.

Parameters:
  • hardware (List[object]) – List of hardware objects to serve.

  • port (int) – Port number to serve on. Defaults to 5025 (commonly used for instrument control).

  • timeout (float) – Timeout in seconds for the server to wait for a client.

  • allowlist (Optional[List[str]]) – List of IP addresses to allow to connect. Defaults to None (allow all). Keep in mind that IP addresses can be spoofed, so this allowlist provides only modest security.

listen(verbose=True)[source]#

Blocking command to listen for client commands and process them once they are given.

Parameters:

verbose (bool) – Whether to print feedback that the server is online alongside a log of client actions.