Archived

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

Problems after upgrading Ice

I recently upgraded to 3.4.2 and I started having some problems. A client program makes a call to a server, passing a struct argument. The server receives the call and runs the appropriate function, but all of the fields of the struct are filled with junk and don't match any of the values on the client side.

The only thing I think could be causing this would be the two programs being compiled with different versions of Ice. I have made sure all occurences of 3.4.1 have been changed to 3.4.2 in the .vcxproj files for the visual studio projects. I have also deleted version 3.4.1 from my computer. Is there anything else I should be looking to change?

Thanks for any help!

Comments

  • mes
    mes California
    Hi Noah,

    We perform binary backward-compatibility tests prior to new patch releases to verify that we haven't broken anything, so it should be possible to simply replace the 3.4.1 DLLs with the 3.4.2 DLLs without recompiling your Slice files or your application.

    It definitely sounds like something is wrong in your situation. Have you tried completely rebuilding the application?

    Regards,
    Mark
  • I cleaned the solutions and rebuilt from scratch and I still have the same problem.

    I also added a struct to the .ice file

    struct TestStruct{
    int test;
    string testString;
    };

    Along with a function on the server to print out the values on the server:

    void testFunc(out TestStruct ts);

    I still get the same problem with this function. Here is the function definition:

    void DataServer::ServerI::testFunc(DataServer::TestStruct& ts, const Ice::Current& current){
    std::cout << ts.test << ":" << ts.testString << std::endl;
    }

    Which is called with "server->testFunc(ts);"

    I assume the code is fine, as its consistent with the code I have written that has worked fine up until this point.

    Any other ideas about what else could be causing this?

    Thanks!
  • xdm
    xdm La Coruña, Spain
    void testFunc(out TestStruct ts);

    You define an output parameter , that is initialized by the server and send to the client. If you want to send a parameter from client to server, use a normal parameter:
    void testFunc(TestStruct ts);

    If you want both use a second out parameter, or the return value
    TestStruct testFunc(TestStruct ts);
    void testFunc(TestStruct ts, out TestStruct result);
    See:
  • Changing from an out parameter to a regular parameter seems to have fixed the problem. Previously I could initialize an out parameter on the client side and everything worked fine. I imagine I was just "lucky".