| 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 | |
| 128 protected: | 125 protected: |
| 129 // Returns a new IP not used before in this network. | 126 // Returns a new IP not used before in this network. |
| 130 IPAddress GetNextIP(int family); | 127 IPAddress GetNextIP(int family); |
| 131 uint16_t GetNextPort(); | 128 uint16_t GetNextPort(); |
| 132 | 129 |
| 133 VirtualSocket* CreateSocketInternal(int family, int type); | 130 VirtualSocket* CreateSocketInternal(int family, int type); |
| 134 | 131 |
| 135 // Binds the given socket to addr, assigning and IP and Port if necessary | 132 // Binds the given socket to addr, assigning and IP and Port if necessary |
| 136 int Bind(VirtualSocket* socket, SocketAddress* addr); | 133 int Bind(VirtualSocket* socket, SocketAddress* addr); |
| 137 | 134 |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 | 349 |
| 353 // Store the options that are set | 350 // Store the options that are set |
| 354 OptionsMap options_map_; | 351 OptionsMap options_map_; |
| 355 | 352 |
| 356 friend class VirtualSocketServer; | 353 friend class VirtualSocketServer; |
| 357 }; | 354 }; |
| 358 | 355 |
| 359 } // namespace rtc | 356 } // namespace rtc |
| 360 | 357 |
| 361 #endif // WEBRTC_BASE_VIRTUALSOCKETSERVER_H_ | 358 #endif // WEBRTC_BASE_VIRTUALSOCKETSERVER_H_ |
| OLD | NEW |