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 |
11 #ifndef WEBRTC_P2P_BASE_TURNSERVER_H_ | 11 #ifndef WEBRTC_P2P_BASE_TURNSERVER_H_ |
12 #define WEBRTC_P2P_BASE_TURNSERVER_H_ | 12 #define WEBRTC_P2P_BASE_TURNSERVER_H_ |
13 | 13 |
14 #include <list> | 14 #include <list> |
15 #include <map> | 15 #include <map> |
16 #include <memory> | 16 #include <memory> |
17 #include <set> | 17 #include <set> |
18 #include <string> | 18 #include <string> |
19 #include <vector> | |
19 | 20 |
20 #include "webrtc/p2p/base/portinterface.h" | 21 #include "webrtc/p2p/base/portinterface.h" |
22 #include "webrtc/base/asyncinvoker.h" | |
21 #include "webrtc/base/asyncpacketsocket.h" | 23 #include "webrtc/base/asyncpacketsocket.h" |
22 #include "webrtc/base/messagequeue.h" | 24 #include "webrtc/base/messagequeue.h" |
23 #include "webrtc/base/sigslot.h" | 25 #include "webrtc/base/sigslot.h" |
24 #include "webrtc/base/socketaddress.h" | 26 #include "webrtc/base/socketaddress.h" |
25 | 27 |
26 namespace rtc { | 28 namespace rtc { |
27 class ByteBufferWriter; | 29 class ByteBufferWriter; |
28 class PacketSocketFactory; | 30 class PacketSocketFactory; |
29 class Thread; | 31 class Thread; |
30 } | 32 } |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
271 TurnRedirectInterface* redirect_hook_; | 273 TurnRedirectInterface* redirect_hook_; |
272 // otu - one-time-use. Server will respond with 438 if it's | 274 // otu - one-time-use. Server will respond with 438 if it's |
273 // sees the same nonce in next transaction. | 275 // sees the same nonce in next transaction. |
274 bool enable_otu_nonce_; | 276 bool enable_otu_nonce_; |
275 bool reject_private_addresses_ = false; | 277 bool reject_private_addresses_ = false; |
276 // Check for permission when receiving an external packet. | 278 // Check for permission when receiving an external packet. |
277 bool enable_permission_checks_ = true; | 279 bool enable_permission_checks_ = true; |
278 | 280 |
279 InternalSocketMap server_sockets_; | 281 InternalSocketMap server_sockets_; |
280 ServerSocketMap server_listen_sockets_; | 282 ServerSocketMap server_listen_sockets_; |
283 // Used when we need to delete a socket asynchronously. | |
284 std::vector<std::unique_ptr<rtc::AsyncPacketSocket>> pending_delete_sockets_; | |
pthatcher1
2016/08/23 00:36:55
I'd prefer a name like sockets_to_delete.
Taylor Brandstetter
2016/08/23 01:11:20
Done.
| |
281 std::unique_ptr<rtc::PacketSocketFactory> external_socket_factory_; | 285 std::unique_ptr<rtc::PacketSocketFactory> external_socket_factory_; |
282 rtc::SocketAddress external_addr_; | 286 rtc::SocketAddress external_addr_; |
283 | 287 |
284 AllocationMap allocations_; | 288 AllocationMap allocations_; |
285 | 289 |
290 rtc::AsyncInvoker invoker_; | |
291 | |
286 // For testing only. If this is non-zero, the next NONCE will be generated | 292 // For testing only. If this is non-zero, the next NONCE will be generated |
287 // from this value, and it will be reset to 0 after generating the NONCE. | 293 // from this value, and it will be reset to 0 after generating the NONCE. |
288 int64_t ts_for_next_nonce_ = 0; | 294 int64_t ts_for_next_nonce_ = 0; |
289 | 295 |
290 friend class TurnServerAllocation; | 296 friend class TurnServerAllocation; |
291 }; | 297 }; |
292 | 298 |
293 } // namespace cricket | 299 } // namespace cricket |
294 | 300 |
295 #endif // WEBRTC_P2P_BASE_TURNSERVER_H_ | 301 #endif // WEBRTC_P2P_BASE_TURNSERVER_H_ |
OLD | NEW |