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

Side by Side Diff: net/tools/quic/end_to_end_test.cc

Issue 1752823002: n/a (QUIC toy client/server changes) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@115400573
Patch Set: Revert to Patch Set 1 Created 4 years, 9 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 | « no previous file | net/tools/quic/quic_client.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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 #include <sys/epoll.h> 6 #include <sys/epoll.h>
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 1490 matching lines...) Expand 10 before | Expand all | Expand 10 after
1501 1501
1502 // Store the client address which was used to send the first request. 1502 // Store the client address which was used to send the first request.
1503 IPEndPoint old_address = client_->client()->GetLatestClientAddress(); 1503 IPEndPoint old_address = client_->client()->GetLatestClientAddress();
1504 1504
1505 // Stop listening and close the old FD. 1505 // Stop listening and close the old FD.
1506 QuicClientPeer::CleanUpUDPSocket(client_->client(), 1506 QuicClientPeer::CleanUpUDPSocket(client_->client(),
1507 client_->client()->GetLatestFD()); 1507 client_->client()->GetLatestFD());
1508 1508
1509 // Create a new socket before closing the old one, which will result in a new 1509 // Create a new socket before closing the old one, which will result in a new
1510 // ephemeral port. 1510 // ephemeral port.
1511 QuicClientPeer::CreateUDPSocket(client_->client()); 1511 QuicClientPeer::CreateUDPSocketAndBind(client_->client());
1512 1512
1513 // The packet writer needs to be updated to use the new FD. 1513 // The packet writer needs to be updated to use the new FD.
1514 client_->client()->CreateQuicPacketWriter(); 1514 client_->client()->CreateQuicPacketWriter();
1515 1515
1516 // Change the internal state of the client and connection to use the new port, 1516 // Change the internal state of the client and connection to use the new port,
1517 // this is done because in a real NAT rebinding the client wouldn't see any 1517 // this is done because in a real NAT rebinding the client wouldn't see any
1518 // port change, and so expects no change to incoming port. 1518 // port change, and so expects no change to incoming port.
1519 // This is kind of ugly, but needed as we are simply swapping out the client 1519 // This is kind of ugly, but needed as we are simply swapping out the client
1520 // FD rather than any more complex NAT rebinding simulation. 1520 // FD rather than any more complex NAT rebinding simulation.
1521 int new_port = client_->client()->GetLatestClientAddress().port(); 1521 int new_port = client_->client()->GetLatestClientAddress().port();
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after
2425 // sending requests for them. 2425 // sending requests for them.
2426 EXPECT_EQ(1u, client_->num_requests()); 2426 EXPECT_EQ(1u, client_->num_requests());
2427 // Including response to original request, 12 responses in total were 2427 // Including response to original request, 12 responses in total were
2428 // recieved. 2428 // recieved.
2429 EXPECT_EQ(12u, client_->num_responses()); 2429 EXPECT_EQ(12u, client_->num_responses());
2430 } 2430 }
2431 2431
2432 } // namespace 2432 } // namespace
2433 } // namespace test 2433 } // namespace test
2434 } // namespace net 2434 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/tools/quic/quic_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698