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

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

Issue 1944683002: Read recv timestamps from socket (posix only). (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase 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
« no previous file with comments | « webrtc/base/virtualsocketserver.h ('k') | webrtc/base/win32socketserver.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 return SendUdp(pv, cb, addr); 257 return SendUdp(pv, cb, addr);
258 } else { 258 } else {
259 if (CS_CONNECTED != state_) { 259 if (CS_CONNECTED != state_) {
260 error_ = ENOTCONN; 260 error_ = ENOTCONN;
261 return -1; 261 return -1;
262 } 262 }
263 return SendTcp(pv, cb); 263 return SendTcp(pv, cb);
264 } 264 }
265 } 265 }
266 266
267 int VirtualSocket::Recv(void* pv, size_t cb) { 267 int VirtualSocket::Recv(void* pv, size_t cb, int64_t* timestamp) {
268 SocketAddress addr; 268 SocketAddress addr;
269 return RecvFrom(pv, cb, &addr); 269 return RecvFrom(pv, cb, &addr, timestamp);
270 } 270 }
271 271
272 int VirtualSocket::RecvFrom(void* pv, size_t cb, SocketAddress* paddr) { 272 int VirtualSocket::RecvFrom(void* pv,
273 size_t cb,
274 SocketAddress* paddr,
275 int64_t* timestamp) {
276 if (timestamp) {
277 *timestamp = -1;
278 }
273 // If we don't have a packet, then either error or wait for one to arrive. 279 // If we don't have a packet, then either error or wait for one to arrive.
274 if (recv_buffer_.empty()) { 280 if (recv_buffer_.empty()) {
275 if (async_) { 281 if (async_) {
276 error_ = EAGAIN; 282 error_ = EAGAIN;
277 return -1; 283 return -1;
278 } 284 }
279 while (recv_buffer_.empty()) { 285 while (recv_buffer_.empty()) {
280 Message msg; 286 Message msg;
281 server_->msg_queue_->Get(&msg); 287 server_->msg_queue_->Get(&msg);
282 server_->msg_queue_->Dispatch(&msg); 288 server_->msg_queue_->Dispatch(&msg);
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 void VirtualSocketServer::SetDefaultRoute(const IPAddress& from_addr) { 1141 void VirtualSocketServer::SetDefaultRoute(const IPAddress& from_addr) {
1136 RTC_DCHECK(!IPIsAny(from_addr)); 1142 RTC_DCHECK(!IPIsAny(from_addr));
1137 if (from_addr.family() == AF_INET) { 1143 if (from_addr.family() == AF_INET) {
1138 default_route_v4_ = from_addr; 1144 default_route_v4_ = from_addr;
1139 } else if (from_addr.family() == AF_INET6) { 1145 } else if (from_addr.family() == AF_INET6) {
1140 default_route_v6_ = from_addr; 1146 default_route_v6_ = from_addr;
1141 } 1147 }
1142 } 1148 }
1143 1149
1144 } // namespace rtc 1150 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/base/virtualsocketserver.h ('k') | webrtc/base/win32socketserver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698