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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 rtc::SocketAddress default_dest_; | 177 rtc::SocketAddress default_dest_; |
178 }; | 178 }; |
179 | 179 |
180 // Records a set of internal and external connections that we relay between, | 180 // Records a set of internal and external connections that we relay between, |
181 // or in other words, that are "bound" together. | 181 // or in other words, that are "bound" together. |
182 class RelayServerBinding : public rtc::MessageHandler { | 182 class RelayServerBinding : public rtc::MessageHandler { |
183 public: | 183 public: |
184 RelayServerBinding(RelayServer* server, | 184 RelayServerBinding(RelayServer* server, |
185 const std::string& username, | 185 const std::string& username, |
186 const std::string& password, | 186 const std::string& password, |
187 uint32_t lifetime); | 187 int lifetime); |
188 virtual ~RelayServerBinding(); | 188 virtual ~RelayServerBinding(); |
189 | 189 |
190 RelayServer* server() { return server_; } | 190 RelayServer* server() { return server_; } |
191 uint32_t lifetime() { return lifetime_; } | 191 int lifetime() { return lifetime_; } |
192 const std::string& username() { return username_; } | 192 const std::string& username() { return username_; } |
193 const std::string& password() { return password_; } | 193 const std::string& password() { return password_; } |
194 const std::string& magic_cookie() { return magic_cookie_; } | 194 const std::string& magic_cookie() { return magic_cookie_; } |
195 | 195 |
196 // Adds/Removes a connection into the binding. | 196 // Adds/Removes a connection into the binding. |
197 void AddInternalConnection(RelayServerConnection* conn); | 197 void AddInternalConnection(RelayServerConnection* conn); |
198 void AddExternalConnection(RelayServerConnection* conn); | 198 void AddExternalConnection(RelayServerConnection* conn); |
199 | 199 |
200 // We keep track of the use of each binding. If we detect that it was not | 200 // We keep track of the use of each binding. If we detect that it was not |
201 // used for longer than the lifetime, then we send a signal. | 201 // used for longer than the lifetime, then we send a signal. |
(...skipping 17 matching lines...) Expand all Loading... |
219 private: | 219 private: |
220 RelayServer* server_; | 220 RelayServer* server_; |
221 | 221 |
222 std::string username_; | 222 std::string username_; |
223 std::string password_; | 223 std::string password_; |
224 std::string magic_cookie_; | 224 std::string magic_cookie_; |
225 | 225 |
226 std::vector<RelayServerConnection*> internal_connections_; | 226 std::vector<RelayServerConnection*> internal_connections_; |
227 std::vector<RelayServerConnection*> external_connections_; | 227 std::vector<RelayServerConnection*> external_connections_; |
228 | 228 |
229 uint32_t lifetime_; | 229 int lifetime_; |
230 uint32_t last_used_; | 230 int64_t last_used_; |
231 // TODO: bandwidth | 231 // TODO: bandwidth |
232 }; | 232 }; |
233 | 233 |
234 } // namespace cricket | 234 } // namespace cricket |
235 | 235 |
236 #endif // WEBRTC_P2P_BASE_RELAYSERVER_H_ | 236 #endif // WEBRTC_P2P_BASE_RELAYSERVER_H_ |
OLD | NEW |