Overview
The client application (backend/client.py) demonstrates how to connect to the remote Conversor service and invoke its methods using ZeroC ICE.
Client Initialization
Initialize the ICE communicator
The communicator is the main entry point for ICE functionality.
Using a context manager ensures proper cleanup when the client exits.
Making Remote Calls
Once you have the proxy, calling remote methods looks like local function calls:Temperature Conversion
Length Conversion
Weight Conversion
Velocity Conversion
Query Available Units
Exception Handling
ICE exceptions are serialized and propagated from server to client:Complete Client Example
Here’s the full client code frombackend/client.py:
Running the Client
Key Concepts
Proxy
A local object that represents the remote server object. Method calls on the proxy are transparently converted to network requests.
Communicator
The ICE runtime that manages connections, threading, and protocol handling.
checkedCast
Runtime verification that the remote object implements the expected interface.
Exception Propagation
Server exceptions are serialized and re-thrown on the client side.
Next Steps
Server Implementation
Learn how the server implements the conversion logic