4#include "Stroika/Foundation/StroikaPreComp.h"
9#include "Socket-Private_.h"
11#include "Stroika/Foundation/IO/Network/ConnectionOrientedMasterSocket.h"
19using namespace Stroika::Foundation::Memory;
20using namespace Stroika::Foundation::IO;
23using namespace Stroika::Foundation::IO::Network::PRIVATE_;
26 struct Rep_ final : BackSocketImpl_<ConnectionOrientedMasterSocket::_IRep> {
27 using inherited = BackSocketImpl_<ConnectionOrientedMasterSocket::_IRep>;
32 virtual void Listen (
unsigned int backlog)
override
36#if qStroika_Foundation_Common_Platform_POSIX
38#elif qStroika_Foundation_Common_Platform_Windows
39 ThrowWSASystemErrorIfSOCKET_ERROR (::listen (fSD_, backlog));
47 sockaddr_storage peer{};
48 socklen_t sz =
sizeof (peer);
49#if qStroika_Foundation_Common_Platform_POSIX
50 return ConnectionOrientedStreamSocket::Attach (
52#elif qStroika_Foundation_Common_Platform_Windows
53 return ConnectionOrientedStreamSocket::Attach (
54 ThrowWSASystemErrorIfSOCKET_ERROR (::accept (fSD_,
reinterpret_cast<sockaddr*
> (&peer), &sz)));
69 return Ptr{Memory::MakeSharedPtr<Rep_> (_Protected::mkLowLevelSocket_ (family, socketKind, protocol))};
74 return Ptr{Memory::MakeSharedPtr<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={})