Home Help Center

Problems after upgrading Ice

nlhainesnlhaines Member Noah Libby HainesOrganization: University of California-BerkeleyProject: Implementing a Realtime Data Server
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

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    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
  • nlhainesnlhaines Member Noah Libby HainesOrganization: University of California-BerkeleyProject: Implementing a Realtime Data Server
    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!
  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    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:
  • nlhainesnlhaines Member Noah Libby HainesOrganization: University of California-BerkeleyProject: Implementing a Realtime Data Server
    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".
Sign In or Register to comment.