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

Side by Side Diff: webrtc/base/ssladapter_unittest.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 2014 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2014 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 int Send(const std::string& message) { 95 int Send(const std::string& message) {
96 LOG(LS_INFO) << "Client sending '" << message << "'"; 96 LOG(LS_INFO) << "Client sending '" << message << "'";
97 97
98 return ssl_adapter_->Send(message.data(), message.length()); 98 return ssl_adapter_->Send(message.data(), message.length());
99 } 99 }
100 100
101 void OnSSLAdapterReadEvent(rtc::AsyncSocket* socket) { 101 void OnSSLAdapterReadEvent(rtc::AsyncSocket* socket) {
102 char buffer[4096] = ""; 102 char buffer[4096] = "";
103 103
104 // Read data received from the server and store it in our internal buffer. 104 // Read data received from the server and store it in our internal buffer.
105 int read = socket->Recv(buffer, sizeof(buffer) - 1); 105 int64_t timestamp;
106 int read = socket->Recv(buffer, sizeof(buffer) - 1, &timestamp);
106 if (read != -1) { 107 if (read != -1) {
107 buffer[read] = '\0'; 108 buffer[read] = '\0';
108 109
109 LOG(LS_INFO) << "Client received '" << buffer << "'"; 110 LOG(LS_INFO) << "Client received '" << buffer << "'";
110 111
111 data_ += buffer; 112 data_ += buffer;
112 } 113 }
113 } 114 }
114 115
115 void OnSSLAdapterCloseEvent(rtc::AsyncSocket* socket, int error) { 116 void OnSSLAdapterCloseEvent(rtc::AsyncSocket* socket, int error) {
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 TestTransfer("Hello, world!"); 415 TestTransfer("Hello, world!");
415 } 416 }
416 417
417 // Test transfer between client and server, using ECDSA 418 // Test transfer between client and server, using ECDSA
418 TEST_F(SSLAdapterTestDTLS_ECDSA, TestDTLSTransfer) { 419 TEST_F(SSLAdapterTestDTLS_ECDSA, TestDTLSTransfer) {
419 TestHandshake(true); 420 TestHandshake(true);
420 TestTransfer("Hello, world!"); 421 TestTransfer("Hello, world!");
421 } 422 }
422 423
423 #endif // SSL_USE_OPENSSL 424 #endif // SSL_USE_OPENSSL
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698