ServiceClient¶
- class bpod_core.ipc.ServiceClient ¶
Bases:
ServiceBase,GenericA client for communicating with
ServiceHost.- Parameters:
service_type (
str) – The 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, default:10.0) – Timeout in seconds for service discovery.txt_properties (
dict, optional) – Properties for service filtering during discovery, by default None.default_data_type (
type, optional) – The default data type for incoming messages.remote (
bool, optional) – Whether to use Zeroconf for discovering remote services, by default True.
- request(request_data, reply_type=None) ¶
Send a generic request to the server.
- Parameters:
- Returns:
The deserialized reply from the server. If
reply_typeis given, returns an instance ofreply_type; otherwise returns an instance ofdefault_data_typedefined during instantiation of the class.- Return type:
- Raises:
RemoteError – If an error occurred on the host side.
ServiceError – If the host sent an unexpected reply kind.