1 // Copyright 2013 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef NET_SOCKET_TCP_SOCKET_H_ 6 #define NET_SOCKET_TCP_SOCKET_H_ 7 8 #include "build/build_config.h" 9 #include "net/base/net_export.h" 10 #include "net/socket/socket_descriptor.h" 11 12 #if BUILDFLAG(IS_WIN) 13 #include "net/socket/tcp_socket_win.h" 14 #elif BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA) 15 #include "net/socket/tcp_socket_posix.h" 16 #endif 17 18 namespace net { 19 20 // TCPSocket provides a platform-independent interface for TCP sockets. 21 // 22 // It is recommended to use TCPClientSocket/TCPServerSocket instead of this 23 // class, unless a clear separation of client and server socket functionality is 24 // not suitable for your use case (e.g., a socket needs to be created and bound 25 // before you know whether it is a client or server socket). 26 #if BUILDFLAG(IS_WIN) 27 typedef TCPSocketWin TCPSocket; 28 #elif BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA) 29 typedef TCPSocketPosix TCPSocket; 30 #endif 31 32 } // namespace net 33 34 #endif // NET_SOCKET_TCP_SOCKET_H_ 35