| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/udp/udp_client_socket.h" | 5 #include "net/udp/udp_client_socket.h" |
| 6 | 6 |
| 7 #include "net/base/net_errors.h" | 7 #include "net/base/net_errors.h" |
| 8 #include "net/log/net_log.h" | 8 #include "net/log/net_log.h" |
| 9 | 9 |
| 10 namespace net { | 10 namespace net { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 rv = BindToNetwork(network); | 46 rv = BindToNetwork(network); |
| 47 // |network| may have disconnected between the call to GetDefaultNetwork() | 47 // |network| may have disconnected between the call to GetDefaultNetwork() |
| 48 // and the call to BindToNetwork(). Loop if this is the case (|rv| will be | 48 // and the call to BindToNetwork(). Loop if this is the case (|rv| will be |
| 49 // ERR_NETWORK_CHANGED). | 49 // ERR_NETWORK_CHANGED). |
| 50 if (rv != ERR_NETWORK_CHANGED) | 50 if (rv != ERR_NETWORK_CHANGED) |
| 51 return rv; | 51 return rv; |
| 52 } | 52 } |
| 53 return rv; | 53 return rv; |
| 54 } | 54 } |
| 55 | 55 |
| 56 NetworkChangeNotifier::NetworkHandle UDPClientSocket::GetBoundNetwork() { | 56 NetworkChangeNotifier::NetworkHandle UDPClientSocket::GetBoundNetwork() const { |
| 57 return network_; | 57 return network_; |
| 58 } | 58 } |
| 59 | 59 |
| 60 int UDPClientSocket::Connect(const IPEndPoint& address) { | 60 int UDPClientSocket::Connect(const IPEndPoint& address) { |
| 61 int rv = socket_.Open(address.GetFamily()); | 61 int rv = socket_.Open(address.GetFamily()); |
| 62 if (rv != OK) | 62 if (rv != OK) |
| 63 return rv; | 63 return rv; |
| 64 return socket_.Connect(address); | 64 return socket_.Connect(address); |
| 65 } | 65 } |
| 66 | 66 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 return socket_.NetLog(); | 100 return socket_.NetLog(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 #if defined(OS_WIN) | 103 #if defined(OS_WIN) |
| 104 void UDPClientSocket::UseNonBlockingIO() { | 104 void UDPClientSocket::UseNonBlockingIO() { |
| 105 socket_.UseNonBlockingIO(); | 105 socket_.UseNonBlockingIO(); |
| 106 } | 106 } |
| 107 #endif | 107 #endif |
| 108 | 108 |
| 109 } // namespace net | 109 } // namespace net |
| OLD | NEW |