Archived

This forum has been archived. Please start a new discussion on GitHub.

Can I set default protocol in command line ?

My server program is :
Ice::ObjectAdapterPtr adapter=
ic->createObjectAdapterWithEndpoints
("SimplePrinterAdapter", "default -p 10000");
I add --Ice.Default.Protocol=udp to make it listening at udp port 10000
But in my client program:
Ice::ObjectPrx base=ic->stringToProxy
("SimplePrinter:default -p 10000");
I add --Ice.Default.Protocol=udp to run it , but it says:
Reference.cpp:880: Ice::NoEndpointException:
no suitable endpoint available for proxy `SimplePrinter -t:udp -h 192.168.3.242 -p 10000'

why not ?

I know I can set protocol property in client program to make client program connect to udp port. But I like I can use command line to control it .

Is it a bug ?

Comments

  • mes
    mes California
    Hi,

    You are probably not using a datagram proxy. You need to do something like this:
    Ice::ObjectPrx base=ic->stringToProxy("SimplePrinter:default -p 10000");
    SimplePrinterPrx printer = SimplePrinterPrx::uncheckedCast(base->ice_datagram());
    
    Take care,
    - Mark
  • I see. Thanks a lot !
    mes wrote:
    Hi,

    You are probably not using a datagram proxy. You need to do something like this:
    Ice::ObjectPrx base=ic->stringToProxy("SimplePrinter:default -p 10000");
    SimplePrinterPrx printer = SimplePrinterPrx::uncheckedCast(base->ice_datagram());
    
    Take care,
    - Mark