OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 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 14 matching lines...) Expand all Loading... | |
25 // response or determine that the request has timed out. | 25 // response or determine that the request has timed out. |
26 class StunRequestManager { | 26 class StunRequestManager { |
27 public: | 27 public: |
28 StunRequestManager(rtc::Thread* thread); | 28 StunRequestManager(rtc::Thread* thread); |
29 ~StunRequestManager(); | 29 ~StunRequestManager(); |
30 | 30 |
31 // Starts sending the given request (perhaps after a delay). | 31 // Starts sending the given request (perhaps after a delay). |
32 void Send(StunRequest* request); | 32 void Send(StunRequest* request); |
33 void SendDelayed(StunRequest* request, int delay); | 33 void SendDelayed(StunRequest* request, int delay); |
34 | 34 |
35 // Sends all pending requests right away. Only for testing. | 35 // If |msg_type| is 0, sends all pending requests right away. |
36 void Flush(); | 36 // Otherwise, sends those that have a matching type right away. |
37 // Only for testing. | |
pthatcher1
2016/01/05 00:10:03
Can you make a named constant for 0, like kAllRequ
honghaiz3
2016/01/05 04:47:39
Done.
| |
38 void Flush(int msg_type); | |
37 | 39 |
38 // Removes a stun request that was added previously. This will happen | 40 // Removes a stun request that was added previously. This will happen |
39 // automatically when a request succeeds, fails, or times out. | 41 // automatically when a request succeeds, fails, or times out. |
40 void Remove(StunRequest* request); | 42 void Remove(StunRequest* request); |
41 | 43 |
42 // Removes all stun requests that were added previously. | 44 // Removes all stun requests that were added previously. |
43 void Clear(); | 45 void Clear(); |
44 | 46 |
45 // Determines whether the given message is a response to one of the | 47 // Determines whether the given message is a response to one of the |
46 // outstanding requests, and if so, processes it appropriately. | 48 // outstanding requests, and if so, processes it appropriately. |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
122 StunRequestManager* manager_; | 124 StunRequestManager* manager_; |
123 StunMessage* msg_; | 125 StunMessage* msg_; |
124 uint32_t tstamp_; | 126 uint32_t tstamp_; |
125 | 127 |
126 friend class StunRequestManager; | 128 friend class StunRequestManager; |
127 }; | 129 }; |
128 | 130 |
129 } // namespace cricket | 131 } // namespace cricket |
130 | 132 |
131 #endif // WEBRTC_P2P_BASE_STUNREQUEST_H_ | 133 #endif // WEBRTC_P2P_BASE_STUNREQUEST_H_ |
OLD | NEW |