Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / net / socket / tcp_socket.h
blob8b36fade758e05db222d9fa4e2ee739e110b2779
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef NET_SOCKET_TCP_SOCKET_H_
6 #define NET_SOCKET_TCP_SOCKET_H_
8 #include "build/build_config.h"
9 #include "net/base/net_export.h"
11 #if defined(OS_WIN)
12 #include "net/socket/tcp_socket_win.h"
13 #elif defined(OS_POSIX)
14 #include "net/socket/tcp_socket_libevent.h"
15 #endif
17 namespace net {
19 // Enable/disable experimental TCP FastOpen option.
20 // Not thread safe. Must be called during initialization/startup only.
21 NET_EXPORT void SetTCPFastOpenEnabled(bool value);
23 // Check if the TCP FastOpen option is enabled.
24 bool IsTCPFastOpenEnabled();
26 // TCPSocket provides a platform-independent interface for TCP sockets.
28 // It is recommended to use TCPClientSocket/TCPServerSocket instead of this
29 // class, unless a clear separation of client and server socket functionality is
30 // not suitable for your use case (e.g., a socket needs to be created and bound
31 // before you know whether it is a client or server socket).
32 #if defined(OS_WIN)
33 typedef TCPSocketWin TCPSocket;
34 #elif defined(OS_POSIX)
35 typedef TCPSocketLibevent TCPSocket;
36 #endif
38 } // namespace net
40 #endif // NET_SOCKET_TCP_SOCKET_H_