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) |
11 #include <ws2tcpip.h> | 11 #include <ws2tcpip.h> |
12 #include "base/object_watcher.h" | 12 #include "base/object_watcher.h" |
13 #elif defined(OS_POSIX) | 13 #elif defined(OS_POSIX) |
14 struct event; // From libevent | 14 struct event; // From libevent |
15 #include <sys/socket.h> // for struct sockaddr | 15 #include <sys/socket.h> // for struct sockaddr |
16 #define SOCKET int | 16 #define SOCKET int |
17 #include "base/message_loop.h" | 17 #include "base/message_loop.h" |
18 #endif | 18 #endif |
19 | 19 |
20 #include "base/scoped_ptr.h" | |
21 #include "net/base/address_list.h" | 20 #include "net/base/address_list.h" |
22 #include "net/base/client_socket.h" | 21 #include "net/base/client_socket.h" |
23 #include "net/base/completion_callback.h" | 22 #include "net/base/completion_callback.h" |
24 | 23 |
25 namespace net { | 24 namespace net { |
26 | 25 |
27 // A client socket that uses TCP as the transport layer. | 26 // A client socket that uses TCP as the transport layer. |
28 // | 27 // |
29 // NOTE: The windows implementation supports half duplex only. | 28 // NOTE: The windows implementation supports half duplex only. |
30 // Read and Write calls must not be in progress at the same time. | 29 // Read and Write calls must not be in progress at the same time. |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 CompletionCallback* callback_; | 131 CompletionCallback* callback_; |
133 | 132 |
134 int CreateSocket(const struct addrinfo* ai); | 133 int CreateSocket(const struct addrinfo* ai); |
135 void DoCallback(int rv); | 134 void DoCallback(int rv); |
136 void DidCompleteConnect(); | 135 void DidCompleteConnect(); |
137 }; | 136 }; |
138 | 137 |
139 } // namespace net | 138 } // namespace net |
140 | 139 |
141 #endif // NET_BASE_TCP_CLIENT_SOCKET_H_ | 140 #endif // NET_BASE_TCP_CLIENT_SOCKET_H_ |
OLD | NEW |