OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2012 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 return; | 107 return; |
108 } | 108 } |
109 | 109 |
110 if (port <= 0) | 110 if (port <= 0) |
111 port = kDefaultServerPort; | 111 port = kDefaultServerPort; |
112 | 112 |
113 server_address_.SetIP(server); | 113 server_address_.SetIP(server); |
114 server_address_.SetPort(port); | 114 server_address_.SetPort(port); |
115 client_name_ = client_name; | 115 client_name_ = client_name; |
116 | 116 |
117 if (server_address_.IsUnresolved()) { | 117 if (server_address_.IsUnresolvedIP()) { |
118 state_ = RESOLVING; | 118 state_ = RESOLVING; |
119 resolver_ = new rtc::AsyncResolver(); | 119 resolver_ = new rtc::AsyncResolver(); |
120 resolver_->SignalDone.connect(this, &PeerConnectionClient::OnResolveResult); | 120 resolver_->SignalDone.connect(this, &PeerConnectionClient::OnResolveResult); |
121 resolver_->Start(server_address_); | 121 resolver_->Start(server_address_); |
122 } else { | 122 } else { |
123 DoConnect(); | 123 DoConnect(); |
124 } | 124 } |
125 } | 125 } |
126 | 126 |
127 void PeerConnectionClient::OnResolveResult( | 127 void PeerConnectionClient::OnResolveResult( |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 Close(); | 505 Close(); |
506 callback_->OnDisconnected(); | 506 callback_->OnDisconnected(); |
507 } | 507 } |
508 } | 508 } |
509 } | 509 } |
510 | 510 |
511 void PeerConnectionClient::OnMessage(rtc::Message* msg) { | 511 void PeerConnectionClient::OnMessage(rtc::Message* msg) { |
512 // ignore msg; there is currently only one supported message ("retry") | 512 // ignore msg; there is currently only one supported message ("retry") |
513 DoConnect(); | 513 DoConnect(); |
514 } | 514 } |
OLD | NEW |