Archived
This forum has been archived. Please start a new discussion on GitHub.
how to send message to server
Hallo.
i want to test the latency for a 1kb message to server.
how do we send a message from client to server?
i want to test the latency for a 1kb message to server.
how do we send a message from client to server?
0
Comments
-
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.0 -
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?0 -
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.0 -
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;
}0 -
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.0 -
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();0 -
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.0