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

Side by Side Diff: webrtc/base/socketstream.cc

Issue 1944683002: Read recv timestamps from socket (posix only). (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix win build. Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2010 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2010 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 return SS_OPENING; 53 return SS_OPENING;
54 case Socket::CS_CLOSED: 54 case Socket::CS_CLOSED:
55 default: 55 default:
56 return SS_CLOSED; 56 return SS_CLOSED;
57 } 57 }
58 } 58 }
59 59
60 StreamResult SocketStream::Read(void* buffer, size_t buffer_len, 60 StreamResult SocketStream::Read(void* buffer, size_t buffer_len,
61 size_t* read, int* error) { 61 size_t* read, int* error) {
62 ASSERT(socket_ != NULL); 62 ASSERT(socket_ != NULL);
63 int result = socket_->Recv(buffer, buffer_len); 63 int64_t timestamp;
64 int result = socket_->Recv(buffer, buffer_len, &timestamp);
64 if (result < 0) { 65 if (result < 0) {
65 if (socket_->IsBlocking()) 66 if (socket_->IsBlocking())
66 return SR_BLOCK; 67 return SR_BLOCK;
67 if (error) 68 if (error)
68 *error = socket_->GetError(); 69 *error = socket_->GetError();
69 return SR_ERROR; 70 return SR_ERROR;
70 } 71 }
71 if ((result > 0) || (buffer_len == 0)) { 72 if ((result > 0) || (buffer_len == 0)) {
72 if (read) 73 if (read)
73 *read = result; 74 *read = result;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 SignalEvent(this, SE_WRITE, 0); 113 SignalEvent(this, SE_WRITE, 0);
113 } 114 }
114 115
115 void SocketStream::OnCloseEvent(AsyncSocket* socket, int err) { 116 void SocketStream::OnCloseEvent(AsyncSocket* socket, int err) {
116 ASSERT(socket == socket_); 117 ASSERT(socket == socket_);
117 SignalEvent(this, SE_CLOSE, err); 118 SignalEvent(this, SE_CLOSE, err);
118 } 119 }
119 120
120 121
121 } // namespace rtc 122 } // namespace rtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698