instrumentserver.base#

Functions

decode(data)

encode(data)

recv(socket)

recvMultipart(socket)

Recieves the broadcast from a broadcast message. It should consist of 2 parts:

recv_router(socket)

send(socket, data[, use_string])

sendBroadcast(socket, name, message)

broadcasts the message. It will send 2 messages: First the name with the send more flag,

send_router(socket, identity, message)

instrumentserver.base.decode(data: str | bytes) Any[source]#
instrumentserver.base.encode(data: Any) str[source]#
instrumentserver.base.recv(socket: Socket) Any[source]#
instrumentserver.base.recvMultipart(socket: Socket) Tuple[str, Any][source]#
Recieves the broadcast from a broadcast message. It should consist of 2 parts:

The first item is the name of the object sending it. Second part the message

instrumentserver.base.recv_router(socket: Socket) Tuple[bytes, Any][source]#
instrumentserver.base.send(socket: Socket, data: Any, use_string: bool = True) Any[source]#
instrumentserver.base.sendBroadcast(socket: Socket, name: str, message: Any) None[source]#
broadcasts the message. It will send 2 messages: First the name with the send more flag,

followed by the message.

Parameters:
  • socket – The socket sending it.

  • name – The name of the object, it will be the first part.

  • messages – The data to send.

instrumentserver.base.send_router(socket: Socket, identity: bytes, message: Any) None[source]#