| 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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 sockaddr_storage saddr; | 431 sockaddr_storage saddr; |
| 432 size_t addr_len = addr.ToSockAddrStorage(&saddr); | 432 size_t addr_len = addr.ToSockAddrStorage(&saddr); |
| 433 int sent = ::sendto(socket_, reinterpret_cast<const char*>(buffer), | 433 int sent = ::sendto(socket_, reinterpret_cast<const char*>(buffer), |
| 434 static_cast<int>(length), 0, | 434 static_cast<int>(length), 0, |
| 435 reinterpret_cast<sockaddr*>(&saddr), | 435 reinterpret_cast<sockaddr*>(&saddr), |
| 436 static_cast<int>(addr_len)); | 436 static_cast<int>(addr_len)); |
| 437 UpdateLastError(); | 437 UpdateLastError(); |
| 438 return sent; | 438 return sent; |
| 439 } | 439 } |
| 440 | 440 |
| 441 int Win32Socket::Recv(void* buffer, size_t length) { | 441 int Win32Socket::Recv(void* buffer, size_t length, int64_t* timestamp) { |
| 442 *timestamp = -1; |
| 442 int received = ::recv(socket_, static_cast<char*>(buffer), | 443 int received = ::recv(socket_, static_cast<char*>(buffer), |
| 443 static_cast<int>(length), 0); | 444 static_cast<int>(length), 0); |
| 444 UpdateLastError(); | 445 UpdateLastError(); |
| 445 if (closing_ && received <= static_cast<int>(length)) | 446 if (closing_ && received <= static_cast<int>(length)) |
| 446 PostClosed(); | 447 PostClosed(); |
| 447 return received; | 448 return received; |
| 448 } | 449 } |
| 449 | 450 |
| 450 int Win32Socket::RecvFrom(void* buffer, size_t length, | 451 int Win32Socket::RecvFrom(void* buffer, |
| 451 SocketAddress* out_addr) { | 452 size_t length, |
| 453 SocketAddress* out_addr, |
| 454 int64_t* timestamp) { |
| 455 *timestamp = -1; |
| 452 sockaddr_storage saddr; | 456 sockaddr_storage saddr; |
| 453 socklen_t addr_len = sizeof(saddr); | 457 socklen_t addr_len = sizeof(saddr); |
| 454 int received = ::recvfrom(socket_, static_cast<char*>(buffer), | 458 int received = ::recvfrom(socket_, static_cast<char*>(buffer), |
| 455 static_cast<int>(length), 0, | 459 static_cast<int>(length), 0, |
| 456 reinterpret_cast<sockaddr*>(&saddr), &addr_len); | 460 reinterpret_cast<sockaddr*>(&saddr), &addr_len); |
| 457 UpdateLastError(); | 461 UpdateLastError(); |
| 458 if (received != SOCKET_ERROR) | 462 if (received != SOCKET_ERROR) |
| 459 SocketAddressFromSockAddrStorage(saddr, out_addr); | 463 SocketAddressFromSockAddrStorage(saddr, out_addr); |
| 460 if (closing_ && received <= static_cast<int>(length)) | 464 if (closing_ && received <= static_cast<int>(length)) |
| 461 PostClosed(); | 465 PostClosed(); |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 bool handled = false; | 849 bool handled = false; |
| 846 if (wm == s_wm_wakeup_id || (wm == WM_TIMER && wp == 1)) { | 850 if (wm == s_wm_wakeup_id || (wm == WM_TIMER && wp == 1)) { |
| 847 ss_->Pump(); | 851 ss_->Pump(); |
| 848 lr = 0; | 852 lr = 0; |
| 849 handled = true; | 853 handled = true; |
| 850 } | 854 } |
| 851 return handled; | 855 return handled; |
| 852 } | 856 } |
| 853 | 857 |
| 854 } // namespace rtc | 858 } // namespace rtc |
| OLD | NEW |