diff options
author | Craig Tiller <ctiller@google.com> | 2015-02-26 14:05:56 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-02-26 14:27:05 -0800 |
commit | cf133f41f84c6c8d306293a5dc8f81fbd9aed1a1 (patch) | |
tree | ce405139ab89b1f4eedf5e8ad41abb015e503e4d /test/cpp/interop | |
parent | a1d7f7f70bd4bbc6976150672220a6fd25e209ca (diff) |
Make it possible to compile with gcc4.6
Diffstat (limited to 'test/cpp/interop')
-rw-r--r-- | test/cpp/interop/client.cc | 5 | ||||
-rw-r--r-- | test/cpp/interop/server.cc | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc index acfaa87ec8..f7537c2d7b 100644 --- a/test/cpp/interop/client.cc +++ b/test/cpp/interop/client.cc @@ -38,6 +38,8 @@ #include <string> #include <thread> +#include <unistd.h> + #include <grpc/grpc.h> #include <grpc/support/log.h> #include <gflags/gflags.h> @@ -313,8 +315,7 @@ void DoResponseStreamingWithSlowConsumer() { GPR_ASSERT(response.payload().body() == grpc::string(kResponseMessageSize, '\0')); gpr_log(GPR_INFO, "received message %d", i); - std::this_thread::sleep_for( - std::chrono::milliseconds(kReceiveDelayMilliSeconds)); + usleep(kReceiveDelayMilliSeconds * 1000); ++i; } GPR_ASSERT(kNumResponseMessages == i); diff --git a/test/cpp/interop/server.cc b/test/cpp/interop/server.cc index 263bd8e304..9810ff6622 100644 --- a/test/cpp/interop/server.cc +++ b/test/cpp/interop/server.cc @@ -36,6 +36,7 @@ #include <thread> #include <signal.h> +#include <unistd.h> #include <gflags/gflags.h> #include <grpc/grpc.h> @@ -222,7 +223,7 @@ void RunServer() { std::unique_ptr<Server> server(builder.BuildAndStart()); gpr_log(GPR_INFO, "Server listening on %s", server_address.str().c_str()); while (!got_sigint) { - std::this_thread::sleep_for(std::chrono::seconds(5)); + sleep(5); } } |