Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Unified Diff: webrtc/base/virtualsocketserver.h

Issue 2261523004: Signal to remove remote candidates if ports are pruned. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Merge to head and fix a comment Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/base/virtualsocketserver.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/virtualsocketserver.h
diff --git a/webrtc/base/virtualsocketserver.h b/webrtc/base/virtualsocketserver.h
index cce0279d32e2a786970ab9370545ea46e9033e22..6782d800a03eeaa6648c1cad310bb0bacbbb03a9 100644
--- a/webrtc/base/virtualsocketserver.h
+++ b/webrtc/base/virtualsocketserver.h
@@ -112,6 +112,10 @@ class VirtualSocketServer : public SocketServer, public sigslot::has_slots<> {
bool Wait(int cms, bool process_io) override;
void WakeUp() override;
+ void SetDelayOnAddress(const rtc::SocketAddress& address, int delay_ms) {
+ delay_by_ip_[address.ipaddr()] = delay_ms;
+ }
+
typedef std::pair<double, double> Point;
typedef std::vector<Point> Function;
@@ -194,8 +198,10 @@ class VirtualSocketServer : public SocketServer, public sigslot::has_slots<> {
// Computes the number of milliseconds required to send a packet of this size.
uint32_t SendDelay(uint32_t size);
- // Returns a random transit delay chosen from the appropriate distribution.
- uint32_t GetRandomTransitDelay();
+ // If the delay has been set for the address of the socket, returns the set
+ // delay. Otherwise, returns a random transit delay chosen from the
+ // appropriate distribution.
+ uint32_t GetTransitDelay(Socket* socket);
// Basic operations on functions. Those that return a function also take
// ownership of the function given (and hence, may modify or delete it).
@@ -243,7 +249,6 @@ class VirtualSocketServer : public SocketServer, public sigslot::has_slots<> {
bool server_owned_;
MessageQueue* msg_queue_;
bool stop_on_idle_;
- int64_t network_delay_;
in_addr next_ipv4_;
in6_addr next_ipv6_;
uint16_t next_port_;
@@ -260,7 +265,10 @@ class VirtualSocketServer : public SocketServer, public sigslot::has_slots<> {
uint32_t delay_mean_;
uint32_t delay_stddev_;
uint32_t delay_samples_;
- Function* delay_dist_;
+
+ std::map<rtc::IPAddress, int> delay_by_ip_;
+ std::unique_ptr<Function> delay_dist_;
+
CriticalSection delay_crit_;
double drop_prob_;
@@ -358,6 +366,9 @@ class VirtualSocket : public AsyncSocket,
// Network model that enforces bandwidth and capacity constraints
NetworkQueue network_;
size_t network_size_;
+ // The scheduled delivery time of the last packet sent on this socket.
+ // It is used to ensure ordered delivery of packets sent on this socket.
+ int64_t last_delivery_time_ = 0;
// Data which has been received from the network
RecvBuffer recv_buffer_;
« no previous file with comments | « no previous file | webrtc/base/virtualsocketserver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698