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