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

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: 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/socketadapters.cc ('k') | webrtc/base/ssladapter_unittest.cc » ('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 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 int result = socket_->Recv(buffer, buffer_len, nullptr);
64 if (result < 0) { 64 if (result < 0) {
65 if (socket_->IsBlocking()) 65 if (socket_->IsBlocking())
66 return SR_BLOCK; 66 return SR_BLOCK;
67 if (error) 67 if (error)
68 *error = socket_->GetError(); 68 *error = socket_->GetError();
69 return SR_ERROR; 69 return SR_ERROR;
70 } 70 }
71 if ((result > 0) || (buffer_len == 0)) { 71 if ((result > 0) || (buffer_len == 0)) {
72 if (read) 72 if (read)
73 *read = result; 73 *read = result;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 SignalEvent(this, SE_WRITE, 0); 112 SignalEvent(this, SE_WRITE, 0);
113 } 113 }
114 114
115 void SocketStream::OnCloseEvent(AsyncSocket* socket, int err) { 115 void SocketStream::OnCloseEvent(AsyncSocket* socket, int err) {
116 ASSERT(socket == socket_); 116 ASSERT(socket == socket_);
117 SignalEvent(this, SE_CLOSE, err); 117 SignalEvent(this, SE_CLOSE, err);
118 } 118 }
119 119
120 120
121 } // namespace rtc 121 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/base/socketadapters.cc ('k') | webrtc/base/ssladapter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698