4#include "Stroika/Foundation/StroikaPreComp.h"
8#include "Socket-Private_.h"
10#include "Stroika/Foundation/IO/Network/ConnectionOrientedMasterSocket.h"
18using namespace Stroika::Foundation::Memory;
19using namespace Stroika::Foundation::IO;
22using namespace Stroika::Foundation::IO::Network::PRIVATE_;
25 struct Rep_ : BackSocketImpl_<ConnectionOrientedMasterSocket::_IRep> {
26 using inherited = BackSocketImpl_<ConnectionOrientedMasterSocket::_IRep>;
31 virtual void Listen (
unsigned int backlog)
override
35#if qStroika_Foundation_Common_Platform_POSIX
37#elif qStroika_Foundation_Common_Platform_Windows
38 ThrowWSASystemErrorIfSOCKET_ERROR (::listen (fSD_, backlog));
46 sockaddr_storage peer{};
47 socklen_t sz =
sizeof (peer);
48#if qStroika_Foundation_Common_Platform_POSIX
49 return ConnectionOrientedStreamSocket::Attach (
51#elif qStroika_Foundation_Common_Platform_Windows
52 return ConnectionOrientedStreamSocket::Attach (
53 ThrowWSASystemErrorIfSOCKET_ERROR (::accept (fSD_,
reinterpret_cast<sockaddr*
> (&peer), &sz)));
68 return Ptr{make_shared<Rep_> (_Protected::mkLowLevelSocket_ (family, socketKind, protocol))};
73 return Ptr{make_shared<Rep_> (sd)};
#define AssertNotImplemented()
unique_lock< AssertExternallySynchronizedMutex > WriteContext
Instantiate AssertExternallySynchronizedMutex::WriteContext to designate an area of code where protec...
FamilyType
Socket address family - also sometimes referred to as domain (argument to ::socket calls it domain)
auto Handle_ErrNoResultInterruption(CALL call) -> decltype(call())
Handle UNIX EINTR system call behavior - fairly transparently - just effectively removes them from th...
Ptr Attach(PlatformNativeHandle sd)
Ptr New(SocketAddress::FamilyType family, Type socketKind, const optional< IPPROTO > &protocol={})