Home Help Center

how to send message to server

leoangleoang Member
Hallo.
i want to test the latency for a 1kb message to server.
how do we send a message from client to server?

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    I recommend you to look at the demos provided with your Ice distribtion. In particular, you should be able to modify the latency demo from the demo/Ice/latency directory to send 1Kb messages and measure the latency.

    Cheers,
    Benoit.
  • leoangleoang Member
    thanks for replying.
    in the latency example, it uses ping to test the latency. i check the example of call back, but it is not sending message too. so what i should do?
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    You should add a method to the Ping interface which has a byte sequence argument. Instead of calling ping, the client would call this method with a 1KB byte sequence. Perhaps modify the throughput demo (from the demo/Ice/throughput directory) would actually be easier :)

    Cheers,
    Benoit.
  • leoangleoang Member
    sorry i am new.
    may i know how to molify the throughput demo to 1kb only?
    i dont understand this part of code
    ByteSeq byteSeq(ByteSeqSize / reduce, 0);
    pair<const Ice::Byte*, const Ice::Byte*> byteArr;
    byteArr.first = &byteSeq[0];
    byteArr.second = byteArr.first + byteSeq.size();

    StringSeq stringSeq(StringSeqSize / reduce, "hello");
    StringDoubleSeq structSeq(StringDoubleSeqSize / reduce);

    for(i = 0; i < StringDoubleSeqSize / reduce; ++i)
    {
    structSeq.s = "hello";
    structSeq.d = 3.14;
    }

    FixedSeq fixedSeq(FixedSeqSize / reduce);
    for(i = 0; i < FixedSeqSize / reduce; ++i)
    {
    fixedSeq.i = 0;
    fixedSeq.j = 0;
    fixedSeq.d = 0;
    }
  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    Something like:
    ByteSeq byteSeq(1024, 0);
    pair<const Ice::Byte*, const Ice::Byte*> byteArr;
    byteArr.first = &byteSeq[0];
    byteArr.second = byteArr.first + byteSeq.size();
    

    Should do the trick.
  • leoangleoang Member
    thanks matthew.
    what is this 3 lines mean?

    pair<const Ice::Byte*, const Ice::Byte*> byteArr;
    byteArr.first = &byteSeq[0];
    byteArr.second = byteArr.first + byteSeq.size();
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    These lines initialize a pair of byte pointers: the first pointer points to the begining of the sequence, the second pointer points to the end of the sequence.

    Please see the "Alternate Sequence Mapping" section in the IceE-1.1.0/README for more information on the array mapping for sequences.

    Cheers,
    Benoit.
Sign In or Register to comment.