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/socket/udp_socket_posix.h" | 5 #include "net/socket/udp_socket_posix.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <net/if.h> | 9 #include <net/if.h> |
10 #include <netdb.h> | 10 #include <netdb.h> |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 net::NetLog* net_log, | 155 net::NetLog* net_log, |
156 const net::NetLogSource& source) | 156 const net::NetLogSource& source) |
157 : socket_(kInvalidSocket), | 157 : socket_(kInvalidSocket), |
158 addr_family_(0), | 158 addr_family_(0), |
159 is_connected_(false), | 159 is_connected_(false), |
160 socket_options_(SOCKET_OPTION_MULTICAST_LOOP), | 160 socket_options_(SOCKET_OPTION_MULTICAST_LOOP), |
161 multicast_interface_(0), | 161 multicast_interface_(0), |
162 multicast_time_to_live_(1), | 162 multicast_time_to_live_(1), |
163 bind_type_(bind_type), | 163 bind_type_(bind_type), |
164 rand_int_cb_(rand_int_cb), | 164 rand_int_cb_(rand_int_cb), |
| 165 read_socket_watcher_(FROM_HERE), |
| 166 write_socket_watcher_(FROM_HERE), |
165 read_watcher_(this), | 167 read_watcher_(this), |
166 write_watcher_(this), | 168 write_watcher_(this), |
167 read_buf_len_(0), | 169 read_buf_len_(0), |
168 recv_from_address_(NULL), | 170 recv_from_address_(NULL), |
169 write_buf_len_(0), | 171 write_buf_len_(0), |
170 net_log_(NetLogWithSource::Make(net_log, NetLogSourceType::UDP_SOCKET)), | 172 net_log_(NetLogWithSource::Make(net_log, NetLogSourceType::UDP_SOCKET)), |
171 bound_network_(NetworkChangeNotifier::kInvalidNetworkHandle) { | 173 bound_network_(NetworkChangeNotifier::kInvalidNetworkHandle) { |
172 net_log_.BeginEvent(NetLogEventType::SOCKET_ALIVE, | 174 net_log_.BeginEvent(NetLogEventType::SOCKET_ALIVE, |
173 source.ToEventParametersCallback()); | 175 source.ToEventParametersCallback()); |
174 if (bind_type == DatagramSocket::RANDOM_BIND) | 176 if (bind_type == DatagramSocket::RANDOM_BIND) |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 return MapSystemError(errno); | 965 return MapSystemError(errno); |
964 | 966 |
965 return OK; | 967 return OK; |
966 } | 968 } |
967 | 969 |
968 void UDPSocketPosix::DetachFromThread() { | 970 void UDPSocketPosix::DetachFromThread() { |
969 base::NonThreadSafe::DetachFromThread(); | 971 base::NonThreadSafe::DetachFromThread(); |
970 } | 972 } |
971 | 973 |
972 } // namespace net | 974 } // namespace net |
OLD | NEW |