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_SOCKET_DESCRIPTOR_H_ 6 #define NET_SOCKET_SOCKET_DESCRIPTOR_H_ 7 8 #include "build/build_config.h" 9 #include "net/base/net_export.h" 10 11 #if BUILDFLAG(IS_WIN) 12 #include "base/win/windows_types.h" 13 #endif 14 15 namespace net { 16 17 #if BUILDFLAG(IS_WIN) 18 typedef UINT_PTR SocketDescriptor; 19 const SocketDescriptor kInvalidSocket = (SocketDescriptor)(~0); 20 #elif BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA) 21 typedef int SocketDescriptor; 22 const SocketDescriptor kInvalidSocket = -1; 23 #endif 24 25 // Creates socket. See WSASocket/socket documentation of parameters. 26 SocketDescriptor NET_EXPORT CreatePlatformSocket(int family, 27 int type, 28 int protocol); 29 30 } // namespace net 31 32 #endif // NET_SOCKET_SOCKET_DESCRIPTOR_H_ 33