| 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 #ifndef NET_SOCKET_TCP_CLIENT_SOCKET_H_ | 5 #ifndef NET_SOCKET_TCP_CLIENT_SOCKET_H_ |
| 6 #define NET_SOCKET_TCP_CLIENT_SOCKET_H_ | 6 #define NET_SOCKET_TCP_CLIENT_SOCKET_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 const net::NetLog::Source& source); | 29 const net::NetLog::Source& source); |
| 30 | 30 |
| 31 // Adopts the given, connected socket and then acts as if Connect() had been | 31 // Adopts the given, connected socket and then acts as if Connect() had been |
| 32 // called. This function is used by TCPServerSocket and for testing. | 32 // called. This function is used by TCPServerSocket and for testing. |
| 33 TCPClientSocket(scoped_ptr<TCPSocket> connected_socket, | 33 TCPClientSocket(scoped_ptr<TCPSocket> connected_socket, |
| 34 const IPEndPoint& peer_address); | 34 const IPEndPoint& peer_address); |
| 35 | 35 |
| 36 ~TCPClientSocket() override; | 36 ~TCPClientSocket() override; |
| 37 | 37 |
| 38 // Binds the socket to a local IP address and port. | 38 // Binds the socket to a local IP address and port. |
| 39 int Bind(const IPEndPoint& address); | 39 virtual int Bind(const IPEndPoint& address); |
| 40 | 40 |
| 41 // StreamSocket implementation. | 41 // StreamSocket implementation. |
| 42 int Connect(const CompletionCallback& callback) override; | 42 int Connect(const CompletionCallback& callback) override; |
| 43 void Disconnect() override; | 43 void Disconnect() override; |
| 44 bool IsConnected() const override; | 44 bool IsConnected() const override; |
| 45 bool IsConnectedAndIdle() const override; | 45 bool IsConnectedAndIdle() const override; |
| 46 int GetPeerAddress(IPEndPoint* address) const override; | 46 int GetPeerAddress(IPEndPoint* address) const override; |
| 47 int GetLocalAddress(IPEndPoint* address) const override; | 47 int GetLocalAddress(IPEndPoint* address) const override; |
| 48 const BoundNetLog& NetLog() const override; | 48 const BoundNetLog& NetLog() const override; |
| 49 void SetSubresourceSpeculation() override; | 49 void SetSubresourceSpeculation() override; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 127 |
| 128 // Failed connection attempts made while trying to connect this socket. | 128 // Failed connection attempts made while trying to connect this socket. |
| 129 ConnectionAttempts connection_attempts_; | 129 ConnectionAttempts connection_attempts_; |
| 130 | 130 |
| 131 DISALLOW_COPY_AND_ASSIGN(TCPClientSocket); | 131 DISALLOW_COPY_AND_ASSIGN(TCPClientSocket); |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 } // namespace net | 134 } // namespace net |
| 135 | 135 |
| 136 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_H_ | 136 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_H_ |
| OLD | NEW |