73 if (
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, 0,
m_num, dwLanguageId, str, NULL)) {
75 str.erase(str.find_last_not_of(_T(
" \t\n\r\f\v")) + 1);
87#if (NTDDI_VERSION >= NTDDI_WINXPSP2) || (_WIN32_WINNT >= 0x0502)
173#pragma warning(disable: 4505)
177 _In_opt_ PCSTR pNodeName,
178 _In_opt_ PCSTR pServiceName,
179 _In_opt_
const ADDRINFOA *pHints,
183 INT iResult =
GetAddrInfoA(pNodeName, pServiceName, pHints, &h);
195 _In_opt_ PCWSTR pNodeName,
196 _In_opt_ PCWSTR pServiceName,
197 _In_opt_
const ADDRINFOW *pHints,
201 INT iResult =
GetAddrInfoW(pNodeName, pServiceName, pHints, &h);
SID wrapper class.
Definition: WinSock2.h:95
void free_internal() noexcept override
Frees address information.
Definition: WinSock2.h:116
virtual ~addrinfo()
Frees address information.
Definition: WinSock2.h:104
Base abstract template class to support generic object handle keeping.
Definition: Common.h:607
handle_type m_h
Object handle.
Definition: Common.h:858
Numerical runtime error.
Definition: Common.h:1003
int error_type
Error number type.
Definition: Common.h:1005
error_type m_num
Numeric error code.
Definition: Common.h:1041
SID wrapper class.
Definition: WinSock2.h:128
virtual ~waddrinfo()
Frees address information.
Definition: WinSock2.h:137
void free_internal() noexcept override
Frees address information.
Definition: WinSock2.h:149
WinSock2 runtime error.
Definition: WinSock2.h:25
ws2_runtime_error(error_type num, const char *msg=nullptr)
Constructs an exception.
Definition: WinSock2.h:43
ws2_runtime_error(const char *msg=nullptr)
Constructs an exception using WSAGetLastError()
Definition: WinSock2.h:61
ws2_runtime_error(error_type num, const std::string &msg)
Constructs an exception.
Definition: WinSock2.h:33
ws2_runtime_error(const std::string &msg)
Constructs an exception using WSAGetLastError()
Definition: WinSock2.h:52
tstring msg(DWORD dwLanguageId=0) const
Returns a user-readable Windows error message.
Definition: WinSock2.h:70
addrinfo taddrinfo
Multi-byte / Wide-character SID wrapper class (according to _UNICODE)
Definition: WinSock2.h:161
static INT GetAddrInfoW(PCWSTR pNodeName, PCWSTR pServiceName, const ADDRINFOW *pHints, winstd::waddrinfo &result)
Provides protocol-independent translation from a host name to an address.
Definition: WinSock2.h:194
static INT GetAddrInfoA(PCSTR pNodeName, PCSTR pServiceName, const ADDRINFOA *pHints, winstd::addrinfo &result)
Provides protocol-independent translation from a host name to an address.
Definition: WinSock2.h:176
std::string tstring
Multi-byte / Wide-character string (according to _UNICODE)
Definition: Common.h:338
#define WINSTD_HANDLE_IMPL(C, INVAL)
Implements default constructors and operators to prevent their auto-generation by compiler.
Definition: Common.h:163
static const PADDRINFOA invalid
Invalid handle value.
Definition: Common.h:617