OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_BASE_TCP_CLIENT_SOCKET_H_ | 5 #ifndef NET_BASE_TCP_CLIENT_SOCKET_H_ |
6 #define NET_BASE_TCP_CLIENT_SOCKET_H_ | 6 #define NET_BASE_TCP_CLIENT_SOCKET_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // connection. | 43 // connection. |
44 explicit TCPClientSocket(const AddressList& addresses); | 44 explicit TCPClientSocket(const AddressList& addresses); |
45 | 45 |
46 ~TCPClientSocket(); | 46 ~TCPClientSocket(); |
47 | 47 |
48 // ClientSocket methods: | 48 // ClientSocket methods: |
49 virtual int Connect(CompletionCallback* callback); | 49 virtual int Connect(CompletionCallback* callback); |
50 virtual int ReconnectIgnoringLastError(CompletionCallback* callback); | 50 virtual int ReconnectIgnoringLastError(CompletionCallback* callback); |
51 virtual void Disconnect(); | 51 virtual void Disconnect(); |
52 virtual bool IsConnected() const; | 52 virtual bool IsConnected() const; |
| 53 virtual bool IsConnectedAndIdle() const; |
53 | 54 |
54 // Socket methods: | 55 // Socket methods: |
55 // Multiple outstanding requests are not supported. | 56 // Multiple outstanding requests are not supported. |
56 // Full duplex mode (reading and writing at the same time) is not supported | 57 // Full duplex mode (reading and writing at the same time) is not supported |
57 // on Windows (but is supported on Linux and Mac for ease of implementation | 58 // on Windows (but is supported on Linux and Mac for ease of implementation |
58 // of SSLClientSocket) | 59 // of SSLClientSocket) |
59 virtual int Read(char* buf, int buf_len, CompletionCallback* callback); | 60 virtual int Read(char* buf, int buf_len, CompletionCallback* callback); |
60 virtual int Write(const char* buf, int buf_len, CompletionCallback* callback); | 61 virtual int Write(const char* buf, int buf_len, CompletionCallback* callback); |
61 | 62 |
62 #if defined(OS_POSIX) | 63 #if defined(OS_POSIX) |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 133 |
133 int CreateSocket(const struct addrinfo* ai); | 134 int CreateSocket(const struct addrinfo* ai); |
134 void DoCallback(int rv); | 135 void DoCallback(int rv); |
135 void DidCompleteConnect(); | 136 void DidCompleteConnect(); |
136 }; | 137 }; |
137 | 138 |
138 } // namespace net | 139 } // namespace net |
139 | 140 |
140 #endif // NET_BASE_TCP_CLIENT_SOCKET_H_ | 141 #endif // NET_BASE_TCP_CLIENT_SOCKET_H_ |
141 | 142 |
OLD | NEW |