instrumentserver.client.core#

Functions

sendRequest(message[, host, port])

Classes

BaseClient([host, port, connect, timeout, ...])

Simple client for the StationServer.

class instrumentserver.client.core.BaseClient(host='localhost', port=5555, connect=True, timeout=20, raise_exceptions=True)[source]#

Bases: object

Simple client for the StationServer. When a timeout happens, a RunTimeError is being raised. This error is there just to warn the user that a timeout has occurred. After that the client will restart the socket to continue the normal work.

Parameters:
  • host – The host address of the server, defaults to localhost.

  • port – The port of the server, defaults to the value of DEFAULT_PORT.

  • connect – If true, the server connects as it is being constructed, defaults to True.

  • timeout – Amount of time that the client waits for an answer before declaring timeout in seconds. Defaults to 20s.

  • raise_exceptions – If true the client will raise an exception when the server sends one to it, defaults to True.

ask(message)[source]#
connect()[source]#
disconnect()[source]#
instrumentserver.client.core.sendRequest(message, host='localhost', port=5555)[source]#