X-Git-Url: http://git.tdb.fi/?p=libs%2Fnet.git;a=blobdiff_plain;f=source%2Fnet%2Fsocket_private.h;fp=source%2Fnet%2Fsocket_private.h;h=742877b4516514b718a623c0185a025a11ddb66f;hp=995ead0f3951b88bff1462d1cea515b97de10278;hb=88bbb4039aa274c7f41ebe3a18085b63427e5475;hpb=6f6845971a21c2d7e04b87925f5e657f0f20ca0d diff --git a/source/net/socket_private.h b/source/net/socket_private.h index 995ead0..742877b 100644 --- a/source/net/socket_private.h +++ b/source/net/socket_private.h @@ -1,32 +1,34 @@ #ifndef MSP_NET_SOCKET_PRIVATE_H_ #define MSP_NET_SOCKET_PRIVATE_H_ +#ifndef MSP_NET_PLATFORM_API_H_ +#error platform_api.h must be included to use private headers +#endif + #include +#include "sockaddr.h" #include "socket.h" +#include "socket_platform.h" namespace Msp { namespace Net { -#ifdef _WIN32 -typedef int socklen_t; -#endif - struct Socket::Private { -#ifdef _WIN32 - SOCKET handle; -#else - int handle; -#endif + SocketHandle handle; /* On POSIX platforms this is the same as the handle. This might seem strange but it allows the same syntax on both POSIX and Windows. */ IO::Handle event; + void set_block(bool); int set_option(int, int, const void *, socklen_t); int get_option(int, int, void *, socklen_t *); }; +unsigned check_sys_error(int, const char *); +bool check_sys_connect_error(int); + } // namespace Net } // namespace Msp