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 "net/tools/quic/quic_simple_client.h" | 5 #include "net/tools/quic/quic_simple_client.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 const DatagramClientSocket* socket) { | 147 const DatagramClientSocket* socket) { |
148 LOG(ERROR) << "QuicSimpleClient read failed: " << ErrorToShortString(result); | 148 LOG(ERROR) << "QuicSimpleClient read failed: " << ErrorToShortString(result); |
149 Disconnect(); | 149 Disconnect(); |
150 } | 150 } |
151 | 151 |
152 QuicSocketAddress QuicSimpleClient::GetLatestClientAddress() const { | 152 QuicSocketAddress QuicSimpleClient::GetLatestClientAddress() const { |
153 return client_address_; | 153 return client_address_; |
154 } | 154 } |
155 | 155 |
156 bool QuicSimpleClient::OnPacket(const QuicReceivedPacket& packet, | 156 bool QuicSimpleClient::OnPacket(const QuicReceivedPacket& packet, |
157 const IPEndPoint& local_address, | 157 const QuicSocketAddress& local_address, |
158 const IPEndPoint& peer_address) { | 158 const QuicSocketAddress& peer_address) { |
159 session()->connection()->ProcessUdpPacket( | 159 session()->connection()->ProcessUdpPacket(local_address, peer_address, |
160 QuicSocketAddress(QuicSocketAddressImpl(local_address)), | 160 packet); |
161 QuicSocketAddress(QuicSocketAddressImpl(peer_address)), packet); | |
162 if (!session()->connection()->connected()) { | 161 if (!session()->connection()->connected()) { |
163 return false; | 162 return false; |
164 } | 163 } |
165 | 164 |
166 return true; | 165 return true; |
167 } | 166 } |
168 | 167 |
169 } // namespace net | 168 } // namespace net |
OLD | NEW |