OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 while (getline(servers, server, ',')) { | 110 while (getline(servers, server, ',')) { |
111 rtc::SocketAddress addr; | 111 rtc::SocketAddress addr; |
112 if (!addr.FromString(server)) { | 112 if (!addr.FromString(server)) { |
113 LOG(LS_ERROR) << "Parsing " << server << " failed."; | 113 LOG(LS_ERROR) << "Parsing " << server << " failed."; |
114 return -1; | 114 return -1; |
115 } | 115 } |
116 server_addresses.push_back(addr); | 116 server_addresses.push_back(addr); |
117 } | 117 } |
118 | 118 |
119 rtc::InitializeSSL(); | 119 rtc::InitializeSSL(); |
120 rtc::InitRandom(rtc::Time()); | 120 rtc::InitRandom(rtc::Time32()); |
121 rtc::Thread* thread = rtc::ThreadManager::Instance()->WrapCurrentThread(); | 121 rtc::Thread* thread = rtc::ThreadManager::Instance()->WrapCurrentThread(); |
122 rtc::scoped_ptr<rtc::BasicPacketSocketFactory> socket_factory( | 122 rtc::scoped_ptr<rtc::BasicPacketSocketFactory> socket_factory( |
123 new rtc::BasicPacketSocketFactory()); | 123 new rtc::BasicPacketSocketFactory()); |
124 rtc::scoped_ptr<rtc::BasicNetworkManager> network_manager( | 124 rtc::scoped_ptr<rtc::BasicNetworkManager> network_manager( |
125 new rtc::BasicNetworkManager()); | 125 new rtc::BasicNetworkManager()); |
126 rtc::NetworkManager::NetworkList networks; | 126 rtc::NetworkManager::NetworkList networks; |
127 network_manager->GetNetworks(&networks); | 127 network_manager->GetNetworks(&networks); |
128 StunProber* prober = | 128 StunProber* prober = |
129 new StunProber(socket_factory.get(), rtc::Thread::Current(), networks); | 129 new StunProber(socket_factory.get(), rtc::Thread::Current(), networks); |
130 auto finish_callback = [thread](StunProber* prober, int result) { | 130 auto finish_callback = [thread](StunProber* prober, int result) { |
131 StopTrial(thread, prober, result); | 131 StopTrial(thread, prober, result); |
132 }; | 132 }; |
133 prober->Start(server_addresses, FLAG_shared_socket, FLAG_interval, | 133 prober->Start(server_addresses, FLAG_shared_socket, FLAG_interval, |
134 FLAG_pings_per_ip, FLAG_timeout, | 134 FLAG_pings_per_ip, FLAG_timeout, |
135 AsyncCallback(finish_callback)); | 135 AsyncCallback(finish_callback)); |
136 thread->Run(); | 136 thread->Run(); |
137 delete prober; | 137 delete prober; |
138 return 0; | 138 return 0; |
139 } | 139 } |
OLD | NEW |