OLD | NEW |
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 <string> | 6 #include <string> |
7 #include <sys/epoll.h> | 7 #include <sys/epoll.h> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 | 1058 |
1059 ASSERT_TRUE(Initialize()); | 1059 ASSERT_TRUE(Initialize()); |
1060 | 1060 |
1061 EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo")); | 1061 EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo")); |
1062 EXPECT_EQ(200u, client_->response_headers()->parsed_response_code()); | 1062 EXPECT_EQ(200u, client_->response_headers()->parsed_response_code()); |
1063 | 1063 |
1064 // Store the client address which was used to send the first request. | 1064 // Store the client address which was used to send the first request. |
1065 IPEndPoint old_address = client_->client()->client_address(); | 1065 IPEndPoint old_address = client_->client()->client_address(); |
1066 | 1066 |
1067 // Stop listening on the old FD. | 1067 // Stop listening on the old FD. |
1068 EpollServer* eps = client_->client()->epoll_server(); | 1068 EpollServer* eps = client_->epoll_server(); |
1069 int old_fd = client_->client()->fd(); | 1069 int old_fd = client_->client()->fd(); |
1070 eps->UnregisterFD(old_fd); | 1070 eps->UnregisterFD(old_fd); |
1071 // Create a new socket before closing the old one, which will result in a new | 1071 // Create a new socket before closing the old one, which will result in a new |
1072 // ephemeral port. | 1072 // ephemeral port. |
1073 QuicClientPeer::CreateUDPSocket(client_->client()); | 1073 QuicClientPeer::CreateUDPSocket(client_->client()); |
1074 close(old_fd); | 1074 close(old_fd); |
1075 | 1075 |
1076 // The packet writer needs to be updated to use the new FD. | 1076 // The packet writer needs to be updated to use the new FD. |
1077 client_->client()->CreateQuicPacketWriter(); | 1077 client_->client()->CreateQuicPacketWriter(); |
1078 | 1078 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 QuicSession* session = dispatcher->session_map().begin()->second; | 1133 QuicSession* session = dispatcher->session_map().begin()->second; |
1134 EXPECT_EQ(kClientIFCW, | 1134 EXPECT_EQ(kClientIFCW, |
1135 session->config()->ReceivedInitialFlowControlWindowBytes()); | 1135 session->config()->ReceivedInitialFlowControlWindowBytes()); |
1136 server_thread_->Resume(); | 1136 server_thread_->Resume(); |
1137 } | 1137 } |
1138 | 1138 |
1139 } // namespace | 1139 } // namespace |
1140 } // namespace test | 1140 } // namespace test |
1141 } // namespace tools | 1141 } // namespace tools |
1142 } // namespace net | 1142 } // namespace net |
OLD | NEW |