X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fnet%2Fwindows%2Fsocket.cpp;h=eadc22af3a2de5355c349d16e201f8d1ec01b032;hb=HEAD;hp=f4fab44c478d491f0677b333dfc26a853113be78;hpb=88bbb4039aa274c7f41ebe3a18085b63427e5475;p=libs%2Fnet.git diff --git a/source/net/windows/socket.cpp b/source/net/windows/socket.cpp index f4fab44..eadc22a 100644 --- a/source/net/windows/socket.cpp +++ b/source/net/windows/socket.cpp @@ -1,11 +1,13 @@ -#include #include "platform_api.h" +#include "socket.h" +#include #include #include #include "sockaddr_private.h" -#include "socket.h" #include "socket_private.h" +using namespace std; + namespace { class WinSockHelper @@ -25,7 +27,7 @@ public: } }; -WinSockHelper wsh; +unique_ptr wsh; } @@ -35,6 +37,8 @@ namespace Net { void Socket::platform_init() { + if(!wsh) + wsh = make_unique(); *priv->event = CreateEvent(0, false, false, 0); } @@ -70,6 +74,10 @@ void Socket::Private::set_block(bool b) ioctlsocket(handle, FIONBIO, &flag); } +void Socket::Private::set_inherit(bool) +{ +} + int Socket::Private::set_option(int level, int optname, const void *optval, socklen_t optlen) { return setsockopt(handle, level, optname, reinterpret_cast(optval), optlen); @@ -81,7 +89,7 @@ int Socket::Private::get_option(int level, int optname, void *optval, socklen_t } -unsigned check_sys_error(int ret, const char *func) +size_t check_sys_error(make_signed::type ret, const char *func) { if(ret<0) {