| henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 +0000 | [diff] [blame] | 1 | /* | 
 | 2 |  *  Copyright 2004 The WebRTC Project Authors. All rights reserved. | 
 | 3 |  * | 
 | 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 | 
 | 6 |  *  tree. An additional intellectual property rights grant can be found | 
 | 7 |  *  in the file PATENTS.  All contributing project authors may | 
 | 8 |  *  be found in the AUTHORS file in the root of the source tree. | 
 | 9 |  */ | 
 | 10 |  | 
| Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef RTC_BASE_VIRTUALSOCKETSERVER_H_ | 
 | 12 | #define RTC_BASE_VIRTUALSOCKETSERVER_H_ | 
| henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 +0000 | [diff] [blame] | 13 |  | 
| Henrik Kjellander | ec78f1c | 2017-06-29 07:52:50 +0200 | [diff] [blame] | 14 | #include <deque> | 
 | 15 | #include <map> | 
| henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 +0000 | [diff] [blame] | 16 |  | 
| Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 17 | #include "rtc_base/checks.h" | 
 | 18 | #include "rtc_base/constructormagic.h" | 
 | 19 | #include "rtc_base/event.h" | 
 | 20 | #include "rtc_base/fakeclock.h" | 
 | 21 | #include "rtc_base/messagequeue.h" | 
 | 22 | #include "rtc_base/socketserver.h" | 
| Henrik Kjellander | ec78f1c | 2017-06-29 07:52:50 +0200 | [diff] [blame] | 23 |  | 
 | 24 | namespace rtc { | 
 | 25 |  | 
 | 26 | class Packet; | 
 | 27 | class VirtualSocket; | 
 | 28 | class SocketAddressPair; | 
 | 29 |  | 
 | 30 | // Simulates a network in the same manner as a loopback interface.  The | 
 | 31 | // interface can create as many addresses as you want.  All of the sockets | 
 | 32 | // created by this network will be able to communicate with one another, unless | 
 | 33 | // they are bound to addresses from incompatible families. | 
 | 34 | class VirtualSocketServer : public SocketServer, public sigslot::has_slots<> { | 
 | 35 |  public: | 
 | 36 |   VirtualSocketServer(); | 
 | 37 |   // This constructor needs to be used if the test uses a fake clock and | 
 | 38 |   // ProcessMessagesUntilIdle, since ProcessMessagesUntilIdle needs a way of | 
 | 39 |   // advancing time. | 
 | 40 |   explicit VirtualSocketServer(FakeClock* fake_clock); | 
 | 41 |   ~VirtualSocketServer() override; | 
 | 42 |  | 
 | 43 |   // The default route indicates which local address to use when a socket is | 
 | 44 |   // bound to the 'any' address, e.g. 0.0.0.0. | 
 | 45 |   IPAddress GetDefaultRoute(int family); | 
 | 46 |   void SetDefaultRoute(const IPAddress& from_addr); | 
 | 47 |  | 
 | 48 |   // Limits the network bandwidth (maximum bytes per second).  Zero means that | 
 | 49 |   // all sends occur instantly.  Defaults to 0. | 
 | 50 |   uint32_t bandwidth() const { return bandwidth_; } | 
 | 51 |   void set_bandwidth(uint32_t bandwidth) { bandwidth_ = bandwidth; } | 
 | 52 |  | 
 | 53 |   // Limits the amount of data which can be in flight on the network without | 
 | 54 |   // packet loss (on a per sender basis).  Defaults to 64 KB. | 
 | 55 |   uint32_t network_capacity() const { return network_capacity_; } | 
 | 56 |   void set_network_capacity(uint32_t capacity) { network_capacity_ = capacity; } | 
 | 57 |  | 
 | 58 |   // The amount of data which can be buffered by tcp on the sender's side | 
 | 59 |   uint32_t send_buffer_capacity() const { return send_buffer_capacity_; } | 
 | 60 |   void set_send_buffer_capacity(uint32_t capacity) { | 
 | 61 |     send_buffer_capacity_ = capacity; | 
 | 62 |   } | 
 | 63 |  | 
 | 64 |   // The amount of data which can be buffered by tcp on the receiver's side | 
 | 65 |   uint32_t recv_buffer_capacity() const { return recv_buffer_capacity_; } | 
 | 66 |   void set_recv_buffer_capacity(uint32_t capacity) { | 
 | 67 |     recv_buffer_capacity_ = capacity; | 
 | 68 |   } | 
 | 69 |  | 
 | 70 |   // Controls the (transit) delay for packets sent in the network.  This does | 
 | 71 |   // not inclue the time required to sit in the send queue.  Both of these | 
 | 72 |   // values are measured in milliseconds.  Defaults to no delay. | 
 | 73 |   uint32_t delay_mean() const { return delay_mean_; } | 
 | 74 |   uint32_t delay_stddev() const { return delay_stddev_; } | 
 | 75 |   uint32_t delay_samples() const { return delay_samples_; } | 
 | 76 |   void set_delay_mean(uint32_t delay_mean) { delay_mean_ = delay_mean; } | 
 | 77 |   void set_delay_stddev(uint32_t delay_stddev) { delay_stddev_ = delay_stddev; } | 
 | 78 |   void set_delay_samples(uint32_t delay_samples) { | 
 | 79 |     delay_samples_ = delay_samples; | 
 | 80 |   } | 
 | 81 |  | 
 | 82 |   // If the (transit) delay parameters are modified, this method should be | 
 | 83 |   // called to recompute the new distribution. | 
 | 84 |   void UpdateDelayDistribution(); | 
 | 85 |  | 
 | 86 |   // Controls the (uniform) probability that any sent packet is dropped.  This | 
 | 87 |   // is separate from calculations to drop based on queue size. | 
 | 88 |   double drop_probability() { return drop_prob_; } | 
 | 89 |   void set_drop_probability(double drop_prob) { | 
 | 90 |     RTC_DCHECK_GE(drop_prob, 0.0); | 
 | 91 |     RTC_DCHECK_LE(drop_prob, 1.0); | 
 | 92 |     drop_prob_ = drop_prob; | 
 | 93 |   } | 
 | 94 |  | 
 | 95 |   // If |blocked| is true, subsequent attempts to send will result in -1 being | 
 | 96 |   // returned, with the socket error set to EWOULDBLOCK. | 
 | 97 |   // | 
 | 98 |   // If this method is later called with |blocked| set to false, any sockets | 
 | 99 |   // that previously failed to send with EWOULDBLOCK will emit SignalWriteEvent. | 
 | 100 |   // | 
 | 101 |   // This can be used to simulate the send buffer on a network interface being | 
 | 102 |   // full, and test functionality related to EWOULDBLOCK/SignalWriteEvent. | 
 | 103 |   void SetSendingBlocked(bool blocked); | 
 | 104 |  | 
 | 105 |   // SocketFactory: | 
 | 106 |   Socket* CreateSocket(int type) override; | 
 | 107 |   Socket* CreateSocket(int family, int type) override; | 
 | 108 |  | 
 | 109 |   AsyncSocket* CreateAsyncSocket(int type) override; | 
 | 110 |   AsyncSocket* CreateAsyncSocket(int family, int type) override; | 
 | 111 |  | 
 | 112 |   // SocketServer: | 
 | 113 |   void SetMessageQueue(MessageQueue* queue) override; | 
 | 114 |   bool Wait(int cms, bool process_io) override; | 
 | 115 |   void WakeUp() override; | 
 | 116 |  | 
 | 117 |   void SetDelayOnAddress(const rtc::SocketAddress& address, int delay_ms) { | 
 | 118 |     delay_by_ip_[address.ipaddr()] = delay_ms; | 
 | 119 |   } | 
 | 120 |  | 
| deadbeef | 5c3c104 | 2017-08-04 15:01:57 -0700 | [diff] [blame] | 121 |   // Used by TurnPortTest and TcpPortTest (for example), to mimic a case where | 
 | 122 |   // a proxy returns the local host address instead of the original one the | 
 | 123 |   // port was bound against. Please see WebRTC issue 3927 for more detail. | 
 | 124 |   // | 
 | 125 |   // If SetAlternativeLocalAddress(A, B) is called, then when something | 
 | 126 |   // attempts to bind a socket to address A, it will get a socket bound to | 
 | 127 |   // address B instead. | 
 | 128 |   void SetAlternativeLocalAddress(const rtc::IPAddress& address, | 
 | 129 |                                   const rtc::IPAddress& alternative); | 
 | 130 |  | 
| Henrik Kjellander | ec78f1c | 2017-06-29 07:52:50 +0200 | [diff] [blame] | 131 |   typedef std::pair<double, double> Point; | 
 | 132 |   typedef std::vector<Point> Function; | 
 | 133 |  | 
 | 134 |   static Function* CreateDistribution(uint32_t mean, | 
 | 135 |                                       uint32_t stddev, | 
 | 136 |                                       uint32_t samples); | 
 | 137 |  | 
 | 138 |   // Similar to Thread::ProcessMessages, but it only processes messages until | 
 | 139 |   // there are no immediate messages or pending network traffic.  Returns false | 
 | 140 |   // if Thread::Stop() was called. | 
 | 141 |   bool ProcessMessagesUntilIdle(); | 
 | 142 |  | 
 | 143 |   // Sets the next port number to use for testing. | 
 | 144 |   void SetNextPortForTesting(uint16_t port); | 
 | 145 |  | 
 | 146 |   // Close a pair of Tcp connections by addresses. Both connections will have | 
 | 147 |   // its own OnClose invoked. | 
 | 148 |   bool CloseTcpConnections(const SocketAddress& addr_local, | 
 | 149 |                            const SocketAddress& addr_remote); | 
 | 150 |  | 
| Taylor Brandstetter | 389a97c | 2018-01-03 16:26:06 -0800 | [diff] [blame] | 151 |   // Number of packets that clients have attempted to send through this virtual | 
 | 152 |   // socket server. Intended to be used for test assertions. | 
 | 153 |   uint32_t sent_packets() const { return sent_packets_; } | 
 | 154 |  | 
| Henrik Kjellander | ec78f1c | 2017-06-29 07:52:50 +0200 | [diff] [blame] | 155 |   // For testing purpose only. Fired when a client socket is created. | 
 | 156 |   sigslot::signal1<VirtualSocket*> SignalSocketCreated; | 
 | 157 |  | 
 | 158 |  protected: | 
 | 159 |   // Returns a new IP not used before in this network. | 
 | 160 |   IPAddress GetNextIP(int family); | 
 | 161 |   uint16_t GetNextPort(); | 
 | 162 |  | 
 | 163 |   VirtualSocket* CreateSocketInternal(int family, int type); | 
 | 164 |  | 
 | 165 |   // Binds the given socket to addr, assigning and IP and Port if necessary | 
 | 166 |   int Bind(VirtualSocket* socket, SocketAddress* addr); | 
 | 167 |  | 
 | 168 |   // Binds the given socket to the given (fully-defined) address. | 
 | 169 |   int Bind(VirtualSocket* socket, const SocketAddress& addr); | 
 | 170 |  | 
 | 171 |   // Find the socket bound to the given address | 
 | 172 |   VirtualSocket* LookupBinding(const SocketAddress& addr); | 
 | 173 |  | 
 | 174 |   int Unbind(const SocketAddress& addr, VirtualSocket* socket); | 
 | 175 |  | 
 | 176 |   // Adds a mapping between this socket pair and the socket. | 
 | 177 |   void AddConnection(const SocketAddress& client, | 
 | 178 |                      const SocketAddress& server, | 
 | 179 |                      VirtualSocket* socket); | 
 | 180 |  | 
 | 181 |   // Find the socket pair corresponding to this server address. | 
 | 182 |   VirtualSocket* LookupConnection(const SocketAddress& client, | 
 | 183 |                                   const SocketAddress& server); | 
 | 184 |  | 
 | 185 |   void RemoveConnection(const SocketAddress& client, | 
 | 186 |                         const SocketAddress& server); | 
 | 187 |  | 
 | 188 |   // Connects the given socket to the socket at the given address | 
 | 189 |   int Connect(VirtualSocket* socket, const SocketAddress& remote_addr, | 
 | 190 |               bool use_delay); | 
 | 191 |  | 
 | 192 |   // Sends a disconnect message to the socket at the given address | 
 | 193 |   bool Disconnect(VirtualSocket* socket); | 
 | 194 |  | 
 | 195 |   // Sends the given packet to the socket at the given address (if one exists). | 
 | 196 |   int SendUdp(VirtualSocket* socket, const char* data, size_t data_size, | 
 | 197 |               const SocketAddress& remote_addr); | 
 | 198 |  | 
 | 199 |   // Moves as much data as possible from the sender's buffer to the network | 
 | 200 |   void SendTcp(VirtualSocket* socket); | 
 | 201 |  | 
 | 202 |   // Places a packet on the network. | 
 | 203 |   void AddPacketToNetwork(VirtualSocket* socket, | 
 | 204 |                           VirtualSocket* recipient, | 
 | 205 |                           int64_t cur_time, | 
 | 206 |                           const char* data, | 
 | 207 |                           size_t data_size, | 
 | 208 |                           size_t header_size, | 
 | 209 |                           bool ordered); | 
 | 210 |  | 
 | 211 |   // Removes stale packets from the network | 
 | 212 |   void PurgeNetworkPackets(VirtualSocket* socket, int64_t cur_time); | 
 | 213 |  | 
 | 214 |   // Computes the number of milliseconds required to send a packet of this size. | 
 | 215 |   uint32_t SendDelay(uint32_t size); | 
 | 216 |  | 
 | 217 |   // If the delay has been set for the address of the socket, returns the set | 
 | 218 |   // delay. Otherwise, returns a random transit delay chosen from the | 
 | 219 |   // appropriate distribution. | 
 | 220 |   uint32_t GetTransitDelay(Socket* socket); | 
 | 221 |  | 
 | 222 |   // Basic operations on functions.  Those that return a function also take | 
 | 223 |   // ownership of the function given (and hence, may modify or delete it). | 
 | 224 |   static Function* Accumulate(Function* f); | 
 | 225 |   static Function* Invert(Function* f); | 
 | 226 |   static Function* Resample(Function* f, | 
 | 227 |                             double x1, | 
 | 228 |                             double x2, | 
 | 229 |                             uint32_t samples); | 
 | 230 |   static double Evaluate(Function* f, double x); | 
 | 231 |  | 
 | 232 |   // Null out our message queue if it goes away. Necessary in the case where | 
 | 233 |   // our lifetime is greater than that of the thread we are using, since we | 
 | 234 |   // try to send Close messages for all connected sockets when we shutdown. | 
 | 235 |   void OnMessageQueueDestroyed() { msg_queue_ = nullptr; } | 
 | 236 |  | 
 | 237 |   // Determine if two sockets should be able to communicate. | 
 | 238 |   // We don't (currently) specify an address family for sockets; instead, | 
 | 239 |   // the currently bound address is used to infer the address family. | 
 | 240 |   // Any socket that is not explicitly bound to an IPv4 address is assumed to be | 
 | 241 |   // dual-stack capable. | 
 | 242 |   // This function tests if two addresses can communicate, as well as the | 
 | 243 |   // sockets to which they may be bound (the addresses may or may not yet be | 
 | 244 |   // bound to the sockets). | 
 | 245 |   // First the addresses are tested (after normalization): | 
 | 246 |   // If both have the same family, then communication is OK. | 
 | 247 |   // If only one is IPv4 then false, unless the other is bound to ::. | 
 | 248 |   // This applies even if the IPv4 address is 0.0.0.0. | 
 | 249 |   // The socket arguments are optional; the sockets are checked to see if they | 
 | 250 |   // were explicitly bound to IPv6-any ('::'), and if so communication is | 
 | 251 |   // permitted. | 
 | 252 |   // NB: This scheme doesn't permit non-dualstack IPv6 sockets. | 
 | 253 |   static bool CanInteractWith(VirtualSocket* local, VirtualSocket* remote); | 
 | 254 |  | 
 | 255 |  private: | 
 | 256 |   friend class VirtualSocket; | 
 | 257 |  | 
 | 258 |   // Sending was previously blocked, but now isn't. | 
 | 259 |   sigslot::signal0<> SignalReadyToSend; | 
 | 260 |  | 
 | 261 |   typedef std::map<SocketAddress, VirtualSocket*> AddressMap; | 
 | 262 |   typedef std::map<SocketAddressPair, VirtualSocket*> ConnectionMap; | 
 | 263 |  | 
 | 264 |   // May be null if the test doesn't use a fake clock, or it does but doesn't | 
 | 265 |   // use ProcessMessagesUntilIdle. | 
 | 266 |   FakeClock* fake_clock_ = nullptr; | 
 | 267 |  | 
 | 268 |   // Used to implement Wait/WakeUp. | 
 | 269 |   Event wakeup_; | 
 | 270 |   MessageQueue* msg_queue_; | 
 | 271 |   bool stop_on_idle_; | 
 | 272 |   in_addr next_ipv4_; | 
 | 273 |   in6_addr next_ipv6_; | 
 | 274 |   uint16_t next_port_; | 
 | 275 |   AddressMap* bindings_; | 
 | 276 |   ConnectionMap* connections_; | 
 | 277 |  | 
 | 278 |   IPAddress default_route_v4_; | 
 | 279 |   IPAddress default_route_v6_; | 
 | 280 |  | 
 | 281 |   uint32_t bandwidth_; | 
 | 282 |   uint32_t network_capacity_; | 
 | 283 |   uint32_t send_buffer_capacity_; | 
 | 284 |   uint32_t recv_buffer_capacity_; | 
 | 285 |   uint32_t delay_mean_; | 
 | 286 |   uint32_t delay_stddev_; | 
 | 287 |   uint32_t delay_samples_; | 
 | 288 |  | 
| Taylor Brandstetter | 389a97c | 2018-01-03 16:26:06 -0800 | [diff] [blame] | 289 |   // Used for testing. | 
 | 290 |   uint32_t sent_packets_ = 0; | 
 | 291 |  | 
| Henrik Kjellander | ec78f1c | 2017-06-29 07:52:50 +0200 | [diff] [blame] | 292 |   std::map<rtc::IPAddress, int> delay_by_ip_; | 
| deadbeef | 5c3c104 | 2017-08-04 15:01:57 -0700 | [diff] [blame] | 293 |   std::map<rtc::IPAddress, rtc::IPAddress> alternative_address_mapping_; | 
| Henrik Kjellander | ec78f1c | 2017-06-29 07:52:50 +0200 | [diff] [blame] | 294 |   std::unique_ptr<Function> delay_dist_; | 
 | 295 |  | 
 | 296 |   CriticalSection delay_crit_; | 
 | 297 |  | 
 | 298 |   double drop_prob_; | 
 | 299 |   bool sending_blocked_ = false; | 
 | 300 |   RTC_DISALLOW_COPY_AND_ASSIGN(VirtualSocketServer); | 
 | 301 | }; | 
 | 302 |  | 
 | 303 | // Implements the socket interface using the virtual network.  Packets are | 
 | 304 | // passed as messages using the message queue of the socket server. | 
 | 305 | class VirtualSocket : public AsyncSocket, | 
 | 306 |                       public MessageHandler, | 
 | 307 |                       public sigslot::has_slots<> { | 
 | 308 |  public: | 
 | 309 |   VirtualSocket(VirtualSocketServer* server, int family, int type, bool async); | 
 | 310 |   ~VirtualSocket() override; | 
 | 311 |  | 
 | 312 |   SocketAddress GetLocalAddress() const override; | 
 | 313 |   SocketAddress GetRemoteAddress() const override; | 
 | 314 |  | 
| Henrik Kjellander | ec78f1c | 2017-06-29 07:52:50 +0200 | [diff] [blame] | 315 |   int Bind(const SocketAddress& addr) override; | 
 | 316 |   int Connect(const SocketAddress& addr) override; | 
 | 317 |   int Close() override; | 
 | 318 |   int Send(const void* pv, size_t cb) override; | 
 | 319 |   int SendTo(const void* pv, size_t cb, const SocketAddress& addr) override; | 
 | 320 |   int Recv(void* pv, size_t cb, int64_t* timestamp) override; | 
 | 321 |   int RecvFrom(void* pv, | 
 | 322 |                size_t cb, | 
 | 323 |                SocketAddress* paddr, | 
 | 324 |                int64_t* timestamp) override; | 
 | 325 |   int Listen(int backlog) override; | 
 | 326 |   VirtualSocket* Accept(SocketAddress* paddr) override; | 
 | 327 |  | 
 | 328 |   int GetError() const override; | 
 | 329 |   void SetError(int error) override; | 
 | 330 |   ConnState GetState() const override; | 
 | 331 |   int GetOption(Option opt, int* value) override; | 
 | 332 |   int SetOption(Option opt, int value) override; | 
 | 333 |   void OnMessage(Message* pmsg) override; | 
 | 334 |  | 
 | 335 |   bool was_any() { return was_any_; } | 
 | 336 |   void set_was_any(bool was_any) { was_any_ = was_any; } | 
 | 337 |  | 
 | 338 |   // For testing purpose only. Fired when client socket is bound to an address. | 
 | 339 |   sigslot::signal2<VirtualSocket*, const SocketAddress&> SignalAddressReady; | 
 | 340 |  | 
 | 341 |  private: | 
 | 342 |   struct NetworkEntry { | 
 | 343 |     size_t size; | 
 | 344 |     int64_t done_time; | 
 | 345 |   }; | 
 | 346 |  | 
 | 347 |   typedef std::deque<SocketAddress> ListenQueue; | 
 | 348 |   typedef std::deque<NetworkEntry> NetworkQueue; | 
 | 349 |   typedef std::vector<char> SendBuffer; | 
 | 350 |   typedef std::list<Packet*> RecvBuffer; | 
 | 351 |   typedef std::map<Option, int> OptionsMap; | 
 | 352 |  | 
 | 353 |   int InitiateConnect(const SocketAddress& addr, bool use_delay); | 
 | 354 |   void CompleteConnect(const SocketAddress& addr, bool notify); | 
 | 355 |   int SendUdp(const void* pv, size_t cb, const SocketAddress& addr); | 
 | 356 |   int SendTcp(const void* pv, size_t cb); | 
 | 357 |  | 
 | 358 |   // Used by server sockets to set the local address without binding. | 
 | 359 |   void SetLocalAddress(const SocketAddress& addr); | 
 | 360 |  | 
 | 361 |   void OnSocketServerReadyToSend(); | 
 | 362 |  | 
 | 363 |   VirtualSocketServer* server_; | 
 | 364 |   int type_; | 
 | 365 |   bool async_; | 
 | 366 |   ConnState state_; | 
 | 367 |   int error_; | 
 | 368 |   SocketAddress local_addr_; | 
| Henrik Kjellander | ec78f1c | 2017-06-29 07:52:50 +0200 | [diff] [blame] | 369 |   SocketAddress remote_addr_; | 
 | 370 |  | 
 | 371 |   // Pending sockets which can be Accepted | 
 | 372 |   ListenQueue* listen_queue_; | 
 | 373 |  | 
 | 374 |   // Data which tcp has buffered for sending | 
 | 375 |   SendBuffer send_buffer_; | 
 | 376 |   // Set to false if the last attempt to send resulted in EWOULDBLOCK. | 
 | 377 |   // Set back to true when the socket can send again. | 
 | 378 |   bool ready_to_send_ = true; | 
 | 379 |  | 
 | 380 |   // Critical section to protect the recv_buffer and queue_ | 
 | 381 |   CriticalSection crit_; | 
 | 382 |  | 
 | 383 |   // Network model that enforces bandwidth and capacity constraints | 
 | 384 |   NetworkQueue network_; | 
 | 385 |   size_t network_size_; | 
 | 386 |   // The scheduled delivery time of the last packet sent on this socket. | 
 | 387 |   // It is used to ensure ordered delivery of packets sent on this socket. | 
 | 388 |   int64_t last_delivery_time_ = 0; | 
 | 389 |  | 
 | 390 |   // Data which has been received from the network | 
 | 391 |   RecvBuffer recv_buffer_; | 
 | 392 |   // The amount of data which is in flight or in recv_buffer_ | 
 | 393 |   size_t recv_buffer_size_; | 
 | 394 |  | 
 | 395 |   // Is this socket bound? | 
 | 396 |   bool bound_; | 
 | 397 |  | 
 | 398 |   // When we bind a socket to Any, VSS's Bind gives it another address. For | 
 | 399 |   // dual-stack sockets, we want to distinguish between sockets that were | 
 | 400 |   // explicitly given a particular address and sockets that had one picked | 
 | 401 |   // for them by VSS. | 
 | 402 |   bool was_any_; | 
 | 403 |  | 
 | 404 |   // Store the options that are set | 
 | 405 |   OptionsMap options_map_; | 
 | 406 |  | 
 | 407 |   friend class VirtualSocketServer; | 
 | 408 | }; | 
 | 409 |  | 
 | 410 | }  // namespace rtc | 
| henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 +0000 | [diff] [blame] | 411 |  | 
| Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 412 | #endif  // RTC_BASE_VIRTUALSOCKETSERVER_H_ |