diff options
author | Andrew Stitcher <astitcher@apache.org> | 2010-06-03 20:48:53 +0000 |
---|---|---|
committer | Andrew Stitcher <astitcher@apache.org> | 2010-06-03 20:48:53 +0000 |
commit | 18fd084c0db4ac659630bc51fddebe668cd2876f (patch) | |
tree | 8c00d0205c3f24b7535f11a8bb1363383c69c1a3 /cpp/examples/messaging | |
parent | 1407ed486f178e408e804c844d833ebdf62aa4e4 (diff) | |
download | qpid-python-18fd084c0db4ac659630bc51fddebe668cd2876f.tar.gz |
Remove dependency on qpid::sys::AbsTime (which uses boost on Windows)
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@951150 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/examples/messaging')
-rw-r--r-- | cpp/examples/messaging/spout.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cpp/examples/messaging/spout.cpp b/cpp/examples/messaging/spout.cpp index 05d66f60e6..e100560739 100644 --- a/cpp/examples/messaging/spout.cpp +++ b/cpp/examples/messaging/spout.cpp @@ -25,19 +25,16 @@ #include <qpid/messaging/Sender.h> #include <qpid/messaging/Session.h> #include <qpid/types/Variant.h> -#include <qpid/sys/Time.h> #include <iostream> #include <sstream> #include <vector> +#include <ctime> #include "OptionParser.h" using namespace qpid::messaging; using namespace qpid::types; -using qpid::sys::AbsTime; -using qpid::sys::now; -using qpid::sys::TIME_INFINITE; typedef std::vector<std::string> string_vector; @@ -152,8 +149,11 @@ int main(int argc, char** argv) message.setContent(options.content); message.setContentType("text/plain"); } - AbsTime end(now(), options.timeout * qpid::sys::TIME_SEC); - for (int count = 0; (count < options.count || options.count == 0) && (options.timeout == 0 || end > now()); count++) { + std::time_t start = std::time(0); + for (int count = 0; + (count < options.count || options.count == 0) && + (options.timeout == 0 || std::difftime(std::time(0), start) < options.timeout); + count++) { if (!options.replyto.empty()) message.setReplyTo(Address(options.replyto)); std::string id = options.id.empty() ? Uuid(true).str() : options.id; std::stringstream spoutid; |