#pragma once #include #include #include #include #include namespace NNeh { typedef TAutoPtr TThreadRef; template static void* HelperMemberFunc(void* arg) { T* obj = reinterpret_cast(arg); (obj->*M)(); return nullptr; } template static TThreadRef Spawn(T* t) { TThreadRef thr(new TThread(HelperMemberFunc, t)); thr->Start(); return thr; } size_t RealStackSize(size_t len) noexcept; //from rfc3986: //host = IP-literal / IPv4address / reg-name //IP-literal = "[" ( IPv6address / IPvFuture ) "]" TString PrintHostByRfc(const NAddr::IRemoteAddr& addr); NAddr::IRemoteAddrPtr GetPeerAddr(SOCKET s); using TAtomicBool = NAtomic::TBool; }