Chromium Code Reviews| 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 #ifndef NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ | 5 #ifndef NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ |
| 6 #define NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ | 6 #define NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 // Local IP address and port we are bound to. Set to NULL if Bind() | 148 // Local IP address and port we are bound to. Set to NULL if Bind() |
| 149 // was't called (in that cases OS chooses address/port). | 149 // was't called (in that cases OS chooses address/port). |
| 150 scoped_ptr<IPEndPoint> bind_address_; | 150 scoped_ptr<IPEndPoint> bind_address_; |
| 151 | 151 |
| 152 // Stores bound socket between Bind() and Connect() calls. | 152 // Stores bound socket between Bind() and Connect() calls. |
| 153 int bound_socket_; | 153 int bound_socket_; |
| 154 | 154 |
| 155 // The list of addresses we should try in order to establish a connection. | 155 // The list of addresses we should try in order to establish a connection. |
| 156 AddressList addresses_; | 156 AddressList addresses_; |
| 157 | 157 |
| 158 // Where we are in above list, or NULL if all addrinfos have been tried. | 158 // Where we are in above list. Set to -1 if uninitialized. |
|
eroman
2012/05/04 01:08:41
I don't like -1 for unsigned values. Please make t
szym
2012/05/04 02:38:29
Will do. That was my initial attempt, but then go
| |
| 159 const struct addrinfo* current_ai_; | 159 size_t current_address_index_; |
| 160 | 160 |
| 161 // The socket's libevent wrappers | 161 // The socket's libevent wrappers |
| 162 MessageLoopForIO::FileDescriptorWatcher read_socket_watcher_; | 162 MessageLoopForIO::FileDescriptorWatcher read_socket_watcher_; |
| 163 MessageLoopForIO::FileDescriptorWatcher write_socket_watcher_; | 163 MessageLoopForIO::FileDescriptorWatcher write_socket_watcher_; |
| 164 | 164 |
| 165 // The corresponding watchers for reads and writes. | 165 // The corresponding watchers for reads and writes. |
| 166 ReadWatcher read_watcher_; | 166 ReadWatcher read_watcher_; |
| 167 WriteWatcher write_watcher_; | 167 WriteWatcher write_watcher_; |
| 168 | 168 |
| 169 // The buffer used by OnSocketReady to retry Read requests | 169 // The buffer used by OnSocketReady to retry Read requests |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 204 base::TimeTicks connect_start_time_; | 204 base::TimeTicks connect_start_time_; |
| 205 base::TimeDelta connect_time_micros_; | 205 base::TimeDelta connect_time_micros_; |
| 206 int64 num_bytes_read_; | 206 int64 num_bytes_read_; |
| 207 | 207 |
| 208 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketLibevent); | 208 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketLibevent); |
| 209 }; | 209 }; |
| 210 | 210 |
| 211 } // namespace net | 211 } // namespace net |
| 212 | 212 |
| 213 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ | 213 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ |
| OLD | NEW |