X-Git-Url: http://git.tdb.fi/?p=libs%2Fnet.git;a=blobdiff_plain;f=source%2Fnet%2Fsocket_private.h;h=bb9eff6f1c280fbce695dbe4afaf37454a7c7845;hp=83cc36947ac561a023f98c4b84f4e90be5cb30ec;hb=HEAD;hpb=50e9f9ea7f7385a2c5931fca2b8fb1103078e67c diff --git a/source/net/socket_private.h b/source/net/socket_private.h index 83cc369..bb9eff6 100644 --- a/source/net/socket_private.h +++ b/source/net/socket_private.h @@ -1,25 +1,35 @@ #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 { 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); + void set_inherit(bool); + int set_option(int, int, const void *, socklen_t); + int get_option(int, int, void *, socklen_t *); }; +std::size_t check_sys_error(std::make_signed::type, const char *); +bool check_sys_connect_error(int); + } // namespace Net } // namespace Msp