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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 bool ProcessMessagesUntilIdle(); | 114 bool ProcessMessagesUntilIdle(); |
115 | 115 |
116 // Sets the next port number to use for testing. | 116 // Sets the next port number to use for testing. |
117 void SetNextPortForTesting(uint16_t port); | 117 void SetNextPortForTesting(uint16_t port); |
118 | 118 |
119 // Close a pair of Tcp connections by addresses. Both connections will have | 119 // Close a pair of Tcp connections by addresses. Both connections will have |
120 // its own OnClose invoked. | 120 // its own OnClose invoked. |
121 bool CloseTcpConnections(const SocketAddress& addr_local, | 121 bool CloseTcpConnections(const SocketAddress& addr_local, |
122 const SocketAddress& addr_remote); | 122 const SocketAddress& addr_remote); |
123 | 123 |
| 124 // For testing purpose only. Fired when a client socket is created. |
| 125 sigslot::signal1<VirtualSocket*> SignalSocketCreated; |
| 126 |
124 protected: | 127 protected: |
125 // Returns a new IP not used before in this network. | 128 // Returns a new IP not used before in this network. |
126 IPAddress GetNextIP(int family); | 129 IPAddress GetNextIP(int family); |
127 uint16_t GetNextPort(); | 130 uint16_t GetNextPort(); |
128 | 131 |
129 VirtualSocket* CreateSocketInternal(int family, int type); | 132 VirtualSocket* CreateSocketInternal(int family, int type); |
130 | 133 |
131 // Binds the given socket to addr, assigning and IP and Port if necessary | 134 // Binds the given socket to addr, assigning and IP and Port if necessary |
132 int Bind(VirtualSocket* socket, SocketAddress* addr); | 135 int Bind(VirtualSocket* socket, SocketAddress* addr); |
133 | 136 |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 | 351 |
349 // Store the options that are set | 352 // Store the options that are set |
350 OptionsMap options_map_; | 353 OptionsMap options_map_; |
351 | 354 |
352 friend class VirtualSocketServer; | 355 friend class VirtualSocketServer; |
353 }; | 356 }; |
354 | 357 |
355 } // namespace rtc | 358 } // namespace rtc |
356 | 359 |
357 #endif // WEBRTC_BASE_VIRTUALSOCKETSERVER_H_ | 360 #endif // WEBRTC_BASE_VIRTUALSOCKETSERVER_H_ |
OLD | NEW |