| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 MSG_ALLOCATE_MISMATCH, | 183 MSG_ALLOCATE_MISMATCH, |
| 184 MSG_TRY_ALTERNATE_SERVER, | 184 MSG_TRY_ALTERNATE_SERVER, |
| 185 MSG_REFRESH_ERROR | 185 MSG_REFRESH_ERROR |
| 186 }; | 186 }; |
| 187 | 187 |
| 188 typedef std::list<TurnEntry*> EntryList; | 188 typedef std::list<TurnEntry*> EntryList; |
| 189 typedef std::map<rtc::Socket::Option, int> SocketOptionsMap; | 189 typedef std::map<rtc::Socket::Option, int> SocketOptionsMap; |
| 190 typedef std::set<rtc::SocketAddress> AttemptedServerSet; | 190 typedef std::set<rtc::SocketAddress> AttemptedServerSet; |
| 191 | 191 |
| 192 virtual void OnMessage(rtc::Message* pmsg); | 192 virtual void OnMessage(rtc::Message* pmsg); |
| 193 virtual void HandleConnectionDestroyed(Connection* conn); |
| 193 | 194 |
| 194 bool CreateTurnClientSocket(); | 195 bool CreateTurnClientSocket(); |
| 195 | 196 |
| 196 void set_nonce(const std::string& nonce) { nonce_ = nonce; } | 197 void set_nonce(const std::string& nonce) { nonce_ = nonce; } |
| 197 void set_realm(const std::string& realm) { | 198 void set_realm(const std::string& realm) { |
| 198 if (realm != realm_) { | 199 if (realm != realm_) { |
| 199 realm_ = realm; | 200 realm_ = realm; |
| 200 UpdateHash(); | 201 UpdateHash(); |
| 201 } | 202 } |
| 202 } | 203 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 TurnEntry* FindEntry(const rtc::SocketAddress& address) const; | 237 TurnEntry* FindEntry(const rtc::SocketAddress& address) const; |
| 237 TurnEntry* FindEntry(int channel_id) const; | 238 TurnEntry* FindEntry(int channel_id) const; |
| 238 bool EntryExists(TurnEntry* e); | 239 bool EntryExists(TurnEntry* e); |
| 239 void CreateOrRefreshEntry(const rtc::SocketAddress& address); | 240 void CreateOrRefreshEntry(const rtc::SocketAddress& address); |
| 240 void DestroyEntry(TurnEntry* entry); | 241 void DestroyEntry(TurnEntry* entry); |
| 241 // Destroys the entry only if |timestamp| matches the destruction timestamp | 242 // Destroys the entry only if |timestamp| matches the destruction timestamp |
| 242 // in |entry|. | 243 // in |entry|. |
| 243 void DestroyEntryIfNotCancelled(TurnEntry* entry, int64_t timestamp); | 244 void DestroyEntryIfNotCancelled(TurnEntry* entry, int64_t timestamp); |
| 244 void ScheduleEntryDestruction(TurnEntry* entry); | 245 void ScheduleEntryDestruction(TurnEntry* entry); |
| 245 void CancelEntryDestruction(TurnEntry* entry); | 246 void CancelEntryDestruction(TurnEntry* entry); |
| 246 void OnConnectionDestroyed(Connection* conn); | |
| 247 | 247 |
| 248 // Destroys the connection with remote address |address|. Returns true if | 248 // Destroys the connection with remote address |address|. Returns true if |
| 249 // a connection is found and destroyed. | 249 // a connection is found and destroyed. |
| 250 bool DestroyConnection(const rtc::SocketAddress& address); | 250 bool DestroyConnection(const rtc::SocketAddress& address); |
| 251 | 251 |
| 252 ProtocolAddress server_address_; | 252 ProtocolAddress server_address_; |
| 253 RelayCredentials credentials_; | 253 RelayCredentials credentials_; |
| 254 AttemptedServerSet attempted_server_addresses_; | 254 AttemptedServerSet attempted_server_addresses_; |
| 255 | 255 |
| 256 rtc::AsyncPacketSocket* socket_; | 256 rtc::AsyncPacketSocket* socket_; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 279 friend class TurnEntry; | 279 friend class TurnEntry; |
| 280 friend class TurnAllocateRequest; | 280 friend class TurnAllocateRequest; |
| 281 friend class TurnRefreshRequest; | 281 friend class TurnRefreshRequest; |
| 282 friend class TurnCreatePermissionRequest; | 282 friend class TurnCreatePermissionRequest; |
| 283 friend class TurnChannelBindRequest; | 283 friend class TurnChannelBindRequest; |
| 284 }; | 284 }; |
| 285 | 285 |
| 286 } // namespace cricket | 286 } // namespace cricket |
| 287 | 287 |
| 288 #endif // WEBRTC_P2P_BASE_TURNPORT_H_ | 288 #endif // WEBRTC_P2P_BASE_TURNPORT_H_ |
| OLD | NEW |