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

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: 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/socketstream.cc ('k') | webrtc/base/testclient.h » ('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 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 int read = socket->Recv(buffer, sizeof(buffer) - 1, nullptr);
106 if (read != -1) { 106 if (read != -1) {
107 buffer[read] = '\0'; 107 buffer[read] = '\0';
108 108
109 LOG(LS_INFO) << "Client received '" << buffer << "'"; 109 LOG(LS_INFO) << "Client received '" << buffer << "'";
110 110
111 data_ += buffer; 111 data_ += buffer;
112 } 112 }
113 } 113 }
114 114
115 void OnSSLAdapterCloseEvent(rtc::AsyncSocket* socket, int error) { 115 void OnSSLAdapterCloseEvent(rtc::AsyncSocket* socket, int error) {
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 TestTransfer("Hello, world!"); 414 TestTransfer("Hello, world!");
415 } 415 }
416 416
417 // Test transfer between client and server, using ECDSA 417 // Test transfer between client and server, using ECDSA
418 TEST_F(SSLAdapterTestDTLS_ECDSA, TestDTLSTransfer) { 418 TEST_F(SSLAdapterTestDTLS_ECDSA, TestDTLSTransfer) {
419 TestHandshake(true); 419 TestHandshake(true);
420 TestTransfer("Hello, world!"); 420 TestTransfer("Hello, world!");
421 } 421 }
422 422
423 #endif // SSL_USE_OPENSSL 423 #endif // SSL_USE_OPENSSL
OLDNEW
« no previous file with comments | « webrtc/base/socketstream.cc ('k') | webrtc/base/testclient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698