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_CLIENT_SOCKET_H_ | 5 #ifndef NET_BASE_CLIENT_SOCKET_H_ |
6 #define NET_BASE_CLIENT_SOCKET_H_ | 6 #define NET_BASE_CLIENT_SOCKET_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #if defined(OS_LINUX) | 10 #if defined(OS_LINUX) |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 // Called to disconnect a connected socket. Does nothing if the socket is | 41 // Called to disconnect a connected socket. Does nothing if the socket is |
42 // already disconnected. After calling Disconnect it is possible to call | 42 // already disconnected. After calling Disconnect it is possible to call |
43 // Connect again to establish a new connection. | 43 // Connect again to establish a new connection. |
44 virtual void Disconnect() = 0; | 44 virtual void Disconnect() = 0; |
45 | 45 |
46 // Called to test if the connection is still alive. Returns false if a | 46 // Called to test if the connection is still alive. Returns false if a |
47 // connection wasn't established or the connection is dead. | 47 // connection wasn't established or the connection is dead. |
48 virtual bool IsConnected() const = 0; | 48 virtual bool IsConnected() const = 0; |
49 | 49 |
| 50 // Called to test if the connection is still alive and idle. Returns false |
| 51 // if a connection wasn't established, the connection is dead, or some data |
| 52 // have been received. |
| 53 virtual bool IsConnectedAndIdle() const = 0; |
| 54 |
50 #if defined(OS_LINUX) | 55 #if defined(OS_LINUX) |
51 // Identical to posix system call getpeername(). | 56 // Identical to posix system call getpeername(). |
52 // Needed by ssl_client_socket_nss. | 57 // Needed by ssl_client_socket_nss. |
53 virtual int GetPeerName(struct sockaddr *name, socklen_t *namelen); | 58 virtual int GetPeerName(struct sockaddr *name, socklen_t *namelen); |
54 #endif | 59 #endif |
55 }; | 60 }; |
56 | 61 |
57 } // namespace net | 62 } // namespace net |
58 | 63 |
59 #endif // NET_BASE_CLIENT_SOCKET_H_ | 64 #endif // NET_BASE_CLIENT_SOCKET_H_ |
60 | 65 |
OLD | NEW |