Archived
Set IP at runtime instead of hardcoding in the config file
Hello, I'm looking for a viable way to set the ip of the device in the Ice runtime, while my program is already running instead of hardcoding in the config file. Is there anyway we can eliminate the use of this config file at all? Here's a snippet of the config file : CallbackSender.Proxy=sender:tcp -x xxx.xxx.xxx.xxx # # Uncomment to use the WebSocket transport instead. # #CallbackSender.Proxy=sender:xx -x xxxxx # # Only connect to the localhost interface by default. # #Ice.Default.Host=localhost # # Warn about connection exceptions # Ice.Warn.Connections=1 # # Network Tracing```` # # 0 = no network tracing # 1 = trace connection establishment and closure # 2 = like 1, but more detailed # 3 = like 2, but also trace data transfer # #Ice.Trace.Network=1 # # Protocol Tracing # # 0 = no protocol tracing # 1 = trace protocol messages # #Ice.Trace.Protocol=1 Ice.MessageSizeMax=20480
Comments
-
This is covered in the proxies documentation, see https://doc.zeroc.com/ice/3.7/client-side-features/proxies/obtaining-proxies
You can also create the properties in your program code and use them to initialize your communicator. Chat demo does something like this in https://github.com/zeroc-ice/ice-demos/blob/3.7/csharp/Chat/net45/Coordinator.cs#L29-L51
0 -
For a device that receives callbacks, the most common solution is to use bidirectional connections:
https://doc.zeroc.com/ice/3.7/client-server-features/connection-management/bidirectional-connectionsIf your device creates proxies with its IP address (regardless of how you supply this IP address), you will need to open ports on your device's firewall to let the requests through. With bidirectional connections, the callbacks (from outside back to the device) reuse the outgoing connections created by the device, so no firewall issue.
0