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 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // each IP address in the list until it succeeds in establishing a | 26 // each IP address in the list until it succeeds in establishing a |
27 // connection. | 27 // connection. |
28 TCPClientSocketLibevent(const AddressList& addresses, | 28 TCPClientSocketLibevent(const AddressList& addresses, |
29 net::NetLog* net_log, | 29 net::NetLog* net_log, |
30 const net::NetLog::Source& source); | 30 const net::NetLog::Source& source); |
31 | 31 |
32 virtual ~TCPClientSocketLibevent(); | 32 virtual ~TCPClientSocketLibevent(); |
33 | 33 |
34 // AdoptSocket causes the given, connected socket to be adopted as a TCP | 34 // AdoptSocket causes the given, connected socket to be adopted as a TCP |
35 // socket. This object must not be connected. This object takes ownership of | 35 // socket. This object must not be connected. This object takes ownership of |
36 // the given socket and then acts as if Connect() had been called. This | 36 // the given socket and then acts as if Connect() had been called. On failure, |
37 // function is used by TCPServerSocket() to adopt accepted connections | 37 // the given socket is closed. |
38 // and for testing. | 38 // This function is used by TCPServerSocket to adopt accepted connections and |
| 39 // for testing. |
39 int AdoptSocket(int socket); | 40 int AdoptSocket(int socket); |
40 | 41 |
41 // Binds the socket to a local IP address and port. | 42 // Binds the socket to a local IP address and port. |
42 int Bind(const IPEndPoint& address); | 43 int Bind(const IPEndPoint& address); |
43 | 44 |
44 // StreamSocket implementation. | 45 // StreamSocket implementation. |
45 virtual int Connect(const CompletionCallback& callback) OVERRIDE; | 46 virtual int Connect(const CompletionCallback& callback) OVERRIDE; |
46 virtual void Disconnect() OVERRIDE; | 47 virtual void Disconnect() OVERRIDE; |
47 virtual bool IsConnected() const OVERRIDE; | 48 virtual bool IsConnected() const OVERRIDE; |
48 virtual bool IsConnectedAndIdle() const OVERRIDE; | 49 virtual bool IsConnectedAndIdle() const OVERRIDE; |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 bool tcp_fastopen_connected_; | 248 bool tcp_fastopen_connected_; |
248 | 249 |
249 enum FastOpenStatus fast_open_status_; | 250 enum FastOpenStatus fast_open_status_; |
250 | 251 |
251 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketLibevent); | 252 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketLibevent); |
252 }; | 253 }; |
253 | 254 |
254 } // namespace net | 255 } // namespace net |
255 | 256 |
256 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ | 257 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ |
OLD | NEW |