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}
This commit is contained in:
Stefan Holmer
2016-05-23 18:19:26 +02:00
parent 181310fb6f
commit 9131efdb30
34 changed files with 256 additions and 89 deletions

View File

@ -60,7 +60,7 @@ StreamState SocketStream::GetState() const {
StreamResult SocketStream::Read(void* buffer, size_t buffer_len,
size_t* read, int* error) {
ASSERT(socket_ != NULL);
int result = socket_->Recv(buffer, buffer_len);
int result = socket_->Recv(buffer, buffer_len, nullptr);
if (result < 0) {
if (socket_->IsBlocking())
return SR_BLOCK;