Read recv timestamps from socket (posix only).
This helps a lot on Android devices where the user threads can be scheduled with low priority when the app is in the background, causing spurious significantly delayed before a packet can be read from the socket. With this patch the timestamp is taken by the kernel when the packet actually arrives.
R=juberti@chromium.org
TBR=juberti@webrtc.org
BUG=webrtc:5773
Review URL: https://codereview.webrtc.org/1944683002 .
Cr-Commit-Position: refs/heads/master@{#12850}
diff --git a/webrtc/base/asyncsocket.cc b/webrtc/base/asyncsocket.cc
index db451c6..089802e 100644
--- a/webrtc/base/asyncsocket.cc
+++ b/webrtc/base/asyncsocket.cc
@@ -64,12 +64,15 @@
return socket_->SendTo(pv, cb, addr);
}
-int AsyncSocketAdapter::Recv(void* pv, size_t cb) {
- return socket_->Recv(pv, cb);
+int AsyncSocketAdapter::Recv(void* pv, size_t cb, int64_t* timestamp) {
+ return socket_->Recv(pv, cb, timestamp);
}
-int AsyncSocketAdapter::RecvFrom(void* pv, size_t cb, SocketAddress* paddr) {
- return socket_->RecvFrom(pv, cb, paddr);
+int AsyncSocketAdapter::RecvFrom(void* pv,
+ size_t cb,
+ SocketAddress* paddr,
+ int64_t* timestamp) {
+ return socket_->RecvFrom(pv, cb, paddr, timestamp);
}
int AsyncSocketAdapter::Listen(int backlog) {