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

Side by Side Diff: webrtc/libjingle/xmpp/xmppsocket.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 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 CreateCricketSocket(addr.family()); 172 CreateCricketSocket(addr.family());
173 } 173 }
174 if (cricket_socket_->Connect(addr) < 0) { 174 if (cricket_socket_->Connect(addr) < 0) {
175 return cricket_socket_->IsBlocking(); 175 return cricket_socket_->IsBlocking();
176 } 176 }
177 return true; 177 return true;
178 } 178 }
179 179
180 bool XmppSocket::Read(char * data, size_t len, size_t* len_read) { 180 bool XmppSocket::Read(char * data, size_t len, size_t* len_read) {
181 #ifndef USE_SSLSTREAM 181 #ifndef USE_SSLSTREAM
182 int read = cricket_socket_->Recv(data, len); 182 int64_t timestamp;
183 int read = cricket_socket_->Recv(data, len, &timestamp);
183 if (read > 0) { 184 if (read > 0) {
184 *len_read = (size_t)read; 185 *len_read = (size_t)read;
185 return true; 186 return true;
186 } 187 }
187 #else // USE_SSLSTREAM 188 #else // USE_SSLSTREAM
188 rtc::StreamResult result = stream_->Read(data, len, len_read, NULL); 189 rtc::StreamResult result = stream_->Read(data, len, len_read, NULL);
189 if (result == rtc::SR_SUCCESS) 190 if (result == rtc::SR_SUCCESS)
190 return true; 191 return true;
191 #endif // USE_SSLSTREAM 192 #endif // USE_SSLSTREAM
192 return false; 193 return false;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 #endif // USE_SSLSTREAM 238 #endif // USE_SSLSTREAM
238 state_ = buzz::AsyncSocket::STATE_TLS_CONNECTING; 239 state_ = buzz::AsyncSocket::STATE_TLS_CONNECTING;
239 return true; 240 return true;
240 #else // !defined(FEATURE_ENABLE_SSL) 241 #else // !defined(FEATURE_ENABLE_SSL)
241 return false; 242 return false;
242 #endif // !defined(FEATURE_ENABLE_SSL) 243 #endif // !defined(FEATURE_ENABLE_SSL)
243 } 244 }
244 245
245 } // namespace buzz 246 } // namespace buzz
246 247
OLDNEW
« webrtc/base/physicalsocketserver.cc ('K') | « webrtc/libjingle/xmpp/xmppsocket.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698