OLD | NEW |
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 Loading... |
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 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1123 void VirtualSocketServer::SetDefaultRoute(const IPAddress& from_addr) { | 1129 void VirtualSocketServer::SetDefaultRoute(const IPAddress& from_addr) { |
1124 RTC_DCHECK(!IPIsAny(from_addr)); | 1130 RTC_DCHECK(!IPIsAny(from_addr)); |
1125 if (from_addr.family() == AF_INET) { | 1131 if (from_addr.family() == AF_INET) { |
1126 default_route_v4_ = from_addr; | 1132 default_route_v4_ = from_addr; |
1127 } else if (from_addr.family() == AF_INET6) { | 1133 } else if (from_addr.family() == AF_INET6) { |
1128 default_route_v6_ = from_addr; | 1134 default_route_v6_ = from_addr; |
1129 } | 1135 } |
1130 } | 1136 } |
1131 | 1137 |
1132 } // namespace rtc | 1138 } // namespace rtc |
OLD | NEW |