X-Git-Url: http://git.tdb.fi/?p=libs%2Fnet.git;a=blobdiff_plain;f=source%2Fstreamlistensocket.cpp;h=3b375bcafcadb54d0581b1cf6500b82a87ca1448;hp=693f3040dc85c0a81dcc1bd6b8271dea8a91f88a;hb=4b408e693bcb004ccaa6958610e946cfbeff9465;hpb=5cf15ce8f6b17a47f662eb8f60de619fd6bf7b53 diff --git a/source/streamlistensocket.cpp b/source/streamlistensocket.cpp index 693f304..3b375bc 100644 --- a/source/streamlistensocket.cpp +++ b/source/streamlistensocket.cpp @@ -1,7 +1,9 @@ #include #include #include +#include #include +#include "socket_private.h" #include "streamlistensocket.h" #include "streamsocket.h" @@ -25,12 +27,12 @@ void StreamListenSocket::listen(const SockAddr &addr, unsigned backlog) { bind(addr); - int err = ::listen(handle, backlog); + int err = ::listen(priv->handle, backlog); if(err==-1) throw system_error("listen"); #ifdef WIN32 - WSAEventSelect(handle, event, FD_ACCEPT); + WSAEventSelect(priv->handle, *priv->event, FD_ACCEPT); #endif set_events(IO::P_INPUT); @@ -44,10 +46,11 @@ StreamSocket *StreamListenSocket::accept() sockaddr_storage sa; socklen_t size = sizeof(sockaddr_storage); - SocketHandle new_h = ::accept(handle, reinterpret_cast(&sa), &size); + Private new_p; + new_p.handle = ::accept(priv->handle, reinterpret_cast(&sa), &size); RefPtr paddr = SockAddr::create(sa); - return new StreamSocket(new_h, *paddr); + return new StreamSocket(new_p, *paddr); } } // namespace Net