diff --git a/examples/cameraDiscoveryExample.py b/examples/cameraDiscoveryExample.py index 831e9e4..5bea459 100644 --- a/examples/cameraDiscoveryExample.py +++ b/examples/cameraDiscoveryExample.py @@ -23,13 +23,13 @@ def main() -> None: def process_event(event: DiscoveryEvent) -> None: log.info('Service discovery event', type=event.type.name, service=event.service) - # Register the event handler to process discovery events + # Register the event handler discoverer.register(process_event) # Start the discoverer with the specified group discoverer.start(group) - # Send the service query + # Send a service query to trigger advertisement from matching services discoverer.discover(query) shutdown_event.wait() diff --git a/examples/cameraServiceExample.py b/examples/cameraServiceExample.py index d4c84a2..3e4fad0 100644 --- a/examples/cameraServiceExample.py +++ b/examples/cameraServiceExample.py @@ -17,9 +17,10 @@ def main() -> None: group = Group(name='effective-range/sniper', url='udp://239.0.1.1:5555') # Define the service information for the camera - info = ServiceInfo(uuid=uuid4(), name='er-sniper-camera-1', role='camera', urls={ - 'device-api': 'grpc://er-sniper-camera-1/device', - 'video-stream': 'blob:http://er-sniper-camera-1/video' + hostname = 'er-sniper-camera-1' + info = ServiceInfo(uuid=uuid4(), name=hostname, role='camera', urls={ + 'api': f'grpc://{hostname}.local:50051', + 'stream': f'http://{hostname}.local:8000' }) # Use a scheduled advertizer to periodically announce the camera service