summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/demo/Ice/throughput/Client.cpp2
-rw-r--r--cpp/demo/Ice/throughput/Throughput.ice2
-rw-r--r--cpp/demo/Ice/throughput/ThroughputI.cpp45
-rw-r--r--cpp/demo/Ice/throughput/ThroughputI.h3
4 files changed, 46 insertions, 6 deletions
diff --git a/cpp/demo/Ice/throughput/Client.cpp b/cpp/demo/Ice/throughput/Client.cpp
index ffdcb15fa4e..03bfd13aeec 100644
--- a/cpp/demo/Ice/throughput/Client.cpp
+++ b/cpp/demo/Ice/throughput/Client.cpp
@@ -70,7 +70,7 @@ ThroughputClient::run(int argc, char* argv[])
menu();
- throughput->ice_ping(); // Initial ping to setup the connection.
+ throughput->endWarmup(); // Initial ping to setup the connection.
//
// By default use byte sequence.
diff --git a/cpp/demo/Ice/throughput/Throughput.ice b/cpp/demo/Ice/throughput/Throughput.ice
index 57cbff4b029..4c62edbb1e9 100644
--- a/cpp/demo/Ice/throughput/Throughput.ice
+++ b/cpp/demo/Ice/throughput/Throughput.ice
@@ -38,6 +38,8 @@ const int FixedSeqSize = 50000;
interface Throughput
{
+ void endWarmup();
+
void sendByteSeq(["cpp:array"] ByteSeq seq);
ByteSeq recvByteSeq();
ByteSeq echoByteSeq(ByteSeq seq);
diff --git a/cpp/demo/Ice/throughput/ThroughputI.cpp b/cpp/demo/Ice/throughput/ThroughputI.cpp
index b769c6c54de..8d0fe46e322 100644
--- a/cpp/demo/Ice/throughput/ThroughputI.cpp
+++ b/cpp/demo/Ice/throughput/ThroughputI.cpp
@@ -14,7 +14,8 @@ ThroughputI::ThroughputI() :
_byteSeq(Demo::ByteSeqSize),
_stringSeq(Demo::StringSeqSize, "hello"),
_structSeq(Demo::StringDoubleSeqSize),
- _fixedSeq(Demo::FixedSeqSize)
+ _fixedSeq(Demo::FixedSeqSize),
+ _warmup(true)
{
int i;
for(i = 0; i < Demo::StringDoubleSeqSize; ++i)
@@ -31,6 +32,12 @@ ThroughputI::ThroughputI() :
}
void
+ThroughputI::endWarmup(const Ice::Current&)
+{
+ _warmup = false;
+}
+
+void
ThroughputI::sendByteSeq(const std::pair<const Ice::Byte*, const Ice::Byte*>&, const Ice::Current&)
{
}
@@ -38,7 +45,14 @@ ThroughputI::sendByteSeq(const std::pair<const Ice::Byte*, const Ice::Byte*>&, c
Demo::ByteSeq
ThroughputI::recvByteSeq(const Ice::Current&)
{
- return _byteSeq;
+ if(_warmup)
+ {
+ return Demo::ByteSeq();
+ }
+ else
+ {
+ return _byteSeq;
+ }
}
Demo::ByteSeq
@@ -55,7 +69,14 @@ ThroughputI::sendStringSeq(const Demo::StringSeq&, const Ice::Current&)
Demo::StringSeq
ThroughputI::recvStringSeq(const Ice::Current&)
{
- return _stringSeq;
+ if(_warmup)
+ {
+ return Demo::StringSeq();
+ }
+ else
+ {
+ return _stringSeq;
+ }
}
Demo::StringSeq
@@ -72,7 +93,14 @@ ThroughputI::sendStructSeq(const Demo::StringDoubleSeq&, const Ice::Current&)
Demo::StringDoubleSeq
ThroughputI::recvStructSeq(const Ice::Current&)
{
- return _structSeq;
+ if(_warmup)
+ {
+ return Demo::StringDoubleSeq();
+ }
+ else
+ {
+ return _structSeq;
+ }
}
Demo::StringDoubleSeq
@@ -89,7 +117,14 @@ ThroughputI::sendFixedSeq(const Demo::FixedSeq&, const Ice::Current&)
Demo::FixedSeq
ThroughputI::recvFixedSeq(const Ice::Current&)
{
- return _fixedSeq;
+ if(_warmup)
+ {
+ return Demo::FixedSeq();
+ }
+ else
+ {
+ return _fixedSeq;
+ }
}
Demo::FixedSeq
diff --git a/cpp/demo/Ice/throughput/ThroughputI.h b/cpp/demo/Ice/throughput/ThroughputI.h
index 5fb68d86cb2..0e3f14fb890 100644
--- a/cpp/demo/Ice/throughput/ThroughputI.h
+++ b/cpp/demo/Ice/throughput/ThroughputI.h
@@ -18,6 +18,7 @@ public:
ThroughputI();
+ virtual void endWarmup(const Ice::Current&);
virtual void sendByteSeq(const std::pair<const Ice::Byte*, const Ice::Byte*>&, const Ice::Current&);
virtual Demo::ByteSeq recvByteSeq(const Ice::Current&);
virtual Demo::ByteSeq echoByteSeq(const Demo::ByteSeq& seq, const Ice::Current&);
@@ -38,6 +39,8 @@ private:
Demo::StringSeq _stringSeq;
Demo::StringDoubleSeq _structSeq;
Demo::FixedSeq _fixedSeq;
+
+ bool _warmup;
};
#endif