From 57d306e78ef329842d89bfe9a1aee6583241c0be Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Mon, 23 Feb 2015 22:40:19 -0800 Subject: [PATCH] Sync-up API change and seed the random generator --- cpp/route_guide/route_guide_client.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cpp/route_guide/route_guide_client.cc b/cpp/route_guide/route_guide_client.cc index 5fb1697934a..acb8dd489d2 100644 --- a/cpp/route_guide/route_guide_client.cc +++ b/cpp/route_guide/route_guide_client.cc @@ -135,7 +135,9 @@ class RouteGuideClient { RouteSummary stats; ClientContext context; const int kPoints = 10; - std::default_random_engine generator; + unsigned seed = std::chrono::system_clock::now().time_since_epoch().count(); + + std::default_random_engine generator(seed); std::uniform_int_distribution feature_distribution( 0, feature_list_.size() - 1); std::uniform_int_distribution delay_distribution( @@ -239,7 +241,7 @@ int main(int argc, char** argv) { std::string db = examples::GetDbFileContent(argc, argv); RouteGuideClient guide( - grpc::CreateChannel("localhost:50051", ChannelArguments()), + grpc::CreateChannelDeprecated("localhost:50051", ChannelArguments()), db); std::cout << "-------------- GetFeature --------------" << std::endl;