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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "net/base/net_api.h" | 10 #include "net/base/net_export.h" |
11 | 11 |
12 #if defined(OS_WIN) | 12 #if defined(OS_WIN) |
13 #include "net/socket/tcp_client_socket_win.h" | 13 #include "net/socket/tcp_client_socket_win.h" |
14 #elif defined(OS_POSIX) | 14 #elif defined(OS_POSIX) |
15 #include "net/socket/tcp_client_socket_libevent.h" | 15 #include "net/socket/tcp_client_socket_libevent.h" |
16 #endif | 16 #endif |
17 | 17 |
18 namespace net { | 18 namespace net { |
19 | 19 |
20 // A client socket that uses TCP as the transport layer. | 20 // A client socket that uses TCP as the transport layer. |
21 #if defined(OS_WIN) | 21 #if defined(OS_WIN) |
22 typedef TCPClientSocketWin TCPClientSocket; | 22 typedef TCPClientSocketWin TCPClientSocket; |
23 #elif defined(OS_POSIX) | 23 #elif defined(OS_POSIX) |
24 typedef TCPClientSocketLibevent TCPClientSocket; | 24 typedef TCPClientSocketLibevent TCPClientSocket; |
25 #endif | 25 #endif |
26 | 26 |
27 // Enable/disable experimental TCP FastOpen option. | 27 // Enable/disable experimental TCP FastOpen option. |
28 // Not thread safe. Must be called during initialization/startup only. | 28 // Not thread safe. Must be called during initialization/startup only. |
29 NET_API void set_tcp_fastopen_enabled(bool value); | 29 NET_EXPORT void set_tcp_fastopen_enabled(bool value); |
30 | 30 |
31 // Check if the TCP FastOpen option is enabled. | 31 // Check if the TCP FastOpen option is enabled. |
32 bool is_tcp_fastopen_enabled(); | 32 bool is_tcp_fastopen_enabled(); |
33 | 33 |
34 } // namespace net | 34 } // namespace net |
35 | 35 |
36 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_H_ | 36 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_H_ |
OLD | NEW |