Archived

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

createObjectAdapterWithEndpoints problem

Hallo, I am new in IceE. I have a problem with createObjectAdapterWithEndpoints. Here is my code.

//server
Ice::ObjectPtr object = new PingI;
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("Latency","tcp -h 192.168.250.73 -p 10003" );

adapter->add(object, Ice::stringToIdentity("ping123"));
adapter->activate();
communicator->waitForShutdown();
return EXIT_SUCCESS;

//client
string proxy = "ping123::tcp -h 192.168.250.73 -p 10003";
Ice::ObjectPrx base = communicator->stringToProxy(proxy);
PingPrx ping = PingPrx::checkedCast(base);
if(!ping)
{
fprintf(stderr, "%s: invalid proxy\n", argv[0]);
return EXIT_FAILURE;
}

while i run the client, error will occour. Here is the error messege.

[root@localhost latency2]# ./client
../../src/TcpTransport/EndpointFactory.cpp:40: Ice::EndpointParseException:
error while parsing endpoint `'

which part of code i should edit.

Comments

  • mes
    mes California
    Welcome to the forum!

    Please update your signature as described in this announcement regarding our support policy on the forum.

    Take care,
    - Mark
  • Thanks mes.
    I had upgrade my signature
  • mes
    mes California
    leoang wrote:
    string proxy = "ping123::tcp -h 192.168.250.73 -p 10003";
    You have an extra colon after the identity in your proxy. Try changing ping123::tcp to ping123:tcp.

    - Mark
  • thanks, i resolve my problem