Home Help Center

"Ice.MessageSizeMax" dosen't work in IceE.1.1.0 c++

qhboqhbo Member bobby quOrganization: xiamen headsun cooperationProject: Traffic Signal Project
I changed the Ice.MessageSizeMax's value to 4096 in server side , but IceE (server side) don't allow the byteSeq data's size > 1024,

help.

Comments

  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    This is explicitely tested in test/IceE/operations -- so its highly unlikely that this is broken. I suspect that the problem is on the client side -- that is the client cannot send more than 1024 bytes and you get an error.
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    Can you please update your user profile (first + last name, project)?
  • qhboqhbo Member bobby quOrganization: xiamen headsun cooperationProject: Traffic Signal Project
    My client is written with C++builder2006, and Ice version is 3.2 for bcb.

    following is the main code :
    Ice::CommunicatorPtr ic = NULL;
    ic = Ice::initialize();
    try
    {
    Ice::PropertiesPtr prop = ic->getProperties();
    stringstream ss;
    std::string msg;

    ss << "CrossUp:tcp -p " << m_port <<" -h " << m_ip.c_str();
    prop->setProperty("Ice.MessageSizeMax", "4096");

    Ice::ObjectPrx base = ic->stringToProxy(ss.str());
    CCrossUpdatePrx up = CCrossUpdatePrx::checkedCast(base);

    //
    // m_data is ByteSeq, not out; msg is a out string for receive error message
    //
    if (up->update(m_data, msg))
    {
    ShowMessage("Ok");
    }else {
    ShowMessage("Failed: "+String(msg.c_str()));
    }

    }catch (const Ice::Exception &ex)
    {
    stringstream ss;
    ss << ex << endl;
    ShowMessage("[failed]: "+String(ss.str().c_str()));
    //
    // following exception message is shown when m_data.size() > 1M bytes.
    // ..\..\include\Ice/BasicStream.h:109: Ice::MemoryLimitException:
    // protocol error: memory limit exceeded
    //
    }catch(...)
    {
    ShowMessage("unknown exception.");
    }
    ic->destroy();
    ic = NULL;
  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    I think the problem is that you initialize the communicator with out properties.

    you must use the initialize versions with InitializationData and create properties before initialize the communicator object

    see Ice Manual 32.2
    Ice::InitializationData id;
    id.logger = new MyLoggerI();
    id.properties = Ice::createProperties();
    id.properties->setProperty("Ice.MessageSizeMax", "4096");
    Ice::CommunicatorPtr ic = Ice::initialize(argc, argv, id);
    
    
  • qhboqhbo Member bobby quOrganization: xiamen headsun cooperationProject: Traffic Signal Project
    xdm wrote: »
    I think the problem is that you initialize the communicator with out properties.

    you must use the initialize versions with InitializationData and create properties before initialize the communicator object

    see Ice Manual 32.2
    Ice::InitializationData id;
    id.logger = new MyLoggerI();
    id.properties = Ice::createProperties();
    id.properties->setProperty("Ice.MessageSizeMax", "4096");
    Ice::CommunicatorPtr ic = Ice::initialize(argc, argv, id);
    
    

    xdm,thank you very much, This problem has troubled me for a whole day.
    thank you.:)
Sign In or Register to comment.