bpod_core.ipc.DualChannelClient

class bpod_core.ipc.DualChannelClient

Bases: DualChannelBase

A client for communicating with a DualChannelHost.

__init__(service_type, address=None, event_handler=None, discovery_timeout=10.0, txt_properties=None)

Initialize a DualChannelClient instance.

Parameters:
  • service_type (str) – The mDNS service type to discover or connect to.

  • address (str, optional) – The direct connection address for the REQ channel, by default None.

  • event_handler (callable, optional) – A callback to handle PUB messages, by default None.

  • discovery_timeout (float, optional) – Timeout in seconds for service discovery, by default 10.0.

  • txt_properties (dict, optional) – Properties for service filtering during discovery, by default None.

request(**kwargs) Any

Send a generic request to the server.

Parameters:

**kwargs (dict) – Key-value pairs to be sent as the request payload.

Returns:

The reply data from the server. Returns an empty dictionary if an error occurs.

Return type:

Any