Cuberite
A lightweight, fast and extensible game server for Minecraft
|
A hostname-to-IP resolver callback that sends the data stored within to the resolved IP address. More...
Public Member Functions | |
cUDPSendAfterLookup (const AString &a_Data, UInt16 a_Port, evutil_socket_t a_MainSock, evutil_socket_t a_SecondSock, bool a_IsMainSockIPv6) | |
Public Member Functions inherited from cNetwork::cResolveNameCallbacks | |
virtual | ~cResolveNameCallbacks () |
Protected Member Functions | |
virtual void | OnError (int a_ErrorCode, const AString &a_ErrorMsg) override |
Called when an error is encountered while resolving. More... | |
virtual void | OnFinished (void) override |
Called when all the addresses resolved have been reported via the OnNameResolved() callback. More... | |
virtual void | OnNameResolved (const AString &a_Name, const AString &a_PI) override |
Called when the hostname is successfully resolved into an IP address. More... | |
virtual bool | OnNameResolvedV4 (const AString &a_Name, const sockaddr_in *a_IP) override |
Called when the hostname is successfully resolved into an IPv4 address. More... | |
virtual bool | OnNameResolvedV6 (const AString &a_Name, const sockaddr_in6 *a_IP) override |
Called when the hostname is successfully resolved into an IPv6 address. More... | |
Protected Attributes | |
sockaddr_in | m_AddrIPv4 |
The IPv4 address resolved, if any. More... | |
sockaddr_in6 | m_AddrIPv6 |
The IPv6 address resolved, if any. More... | |
AString | m_Data |
The data to send after the hostname is resolved. More... | |
bool | m_HasIPv4 |
Set to true if the name resolved to an IPv4 address. More... | |
bool | m_HasIPv6 |
Set to true if the name resolved to an IPv6 address. More... | |
bool | m_IsMainSockIPv6 |
True if m_MainSock is an IPv6 socket. More... | |
evutil_socket_t | m_MainSock |
The primary socket to use for sending. More... | |
UInt16 | m_Port |
The port to which to send the data. More... | |
evutil_socket_t | m_SecondSock |
The secondary socket to use for sending, if needed by the OS. More... | |
A hostname-to-IP resolver callback that sends the data stored within to the resolved IP address.
This is used for sending UDP datagrams to hostnames, so that the cUDPEndpoint::Send() doesn't block. Instead an instance of this callback is queued for resolving and the data is sent once the IP is resolved.
Definition at line 57 of file UDPEndpointImpl.cpp.
|
inline |
Definition at line 61 of file UDPEndpointImpl.cpp.
|
inlineoverrideprotectedvirtual |
Called when an error is encountered while resolving.
If an error is reported, the OnFinished() callback is not called.
Implements cNetwork::cResolveNameCallbacks.
Definition at line 174 of file UDPEndpointImpl.cpp.
|
inlineoverrideprotectedvirtual |
Called when all the addresses resolved have been reported via the OnNameResolved() callback.
Only called if there was no error reported.
Implements cNetwork::cResolveNameCallbacks.
Definition at line 133 of file UDPEndpointImpl.cpp.
|
inlineoverrideprotectedvirtual |
Called when the hostname is successfully resolved into an IP address.
May be called multiple times if a name resolves to multiple addresses. a_IP may be either an IPv4 or an IPv6 address with their proper formatting. Each call to OnNameResolved() is preceded by a call to either OnNameResolvedV4() or OnNameResolvedV6().
Implements cNetwork::cResolveNameCallbacks.
Definition at line 102 of file UDPEndpointImpl.cpp.
|
inlineoverrideprotectedvirtual |
Called when the hostname is successfully resolved into an IPv4 address.
May be called multiple times if a name resolves to multiple addresses. Each call to OnNameResolvedV4 is followed by OnNameResolved with the IP address serialized to a string. If this callback returns false, the OnNameResolved() call is skipped for this address.
Reimplemented from cNetwork::cResolveNameCallbacks.
Definition at line 107 of file UDPEndpointImpl.cpp.
|
inlineoverrideprotectedvirtual |
Called when the hostname is successfully resolved into an IPv6 address.
May be called multiple times if a name resolves to multiple addresses. Each call to OnNameResolvedV4 is followed by OnNameResolved with the IP address serialized to a string. If this callback returns false, the OnNameResolved() call is skipped for this address.
Reimplemented from cNetwork::cResolveNameCallbacks.
Definition at line 120 of file UDPEndpointImpl.cpp.
|
protected |
The IPv4 address resolved, if any.
Definition at line 89 of file UDPEndpointImpl.cpp.
|
protected |
The IPv6 address resolved, if any.
Definition at line 95 of file UDPEndpointImpl.cpp.
|
protected |
The data to send after the hostname is resolved.
Definition at line 74 of file UDPEndpointImpl.cpp.
|
protected |
Set to true if the name resolved to an IPv4 address.
Definition at line 92 of file UDPEndpointImpl.cpp.
|
protected |
Set to true if the name resolved to an IPv6 address.
Definition at line 98 of file UDPEndpointImpl.cpp.
|
protected |
True if m_MainSock is an IPv6 socket.
Definition at line 86 of file UDPEndpointImpl.cpp.
|
protected |
The primary socket to use for sending.
Definition at line 80 of file UDPEndpointImpl.cpp.
|
protected |
The port to which to send the data.
Definition at line 77 of file UDPEndpointImpl.cpp.
|
protected |
The secondary socket to use for sending, if needed by the OS.
Definition at line 83 of file UDPEndpointImpl.cpp.