Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <LuaNameLookup.h>
Public Member Functions | |
cLuaNameLookup (const AString &a_Query, cLuaState::cTableRefPtr &&a_Callbacks) | |
Creates a new instance of the lookup callbacks for the specified query, using the callbacks that are in the specified table. More... | |
Public Member Functions inherited from cNetwork::cResolveNameCallbacks | |
virtual bool | OnNameResolvedV4 (const AString &a_Name, const sockaddr_in *a_IP) |
Called when the hostname is successfully resolved into an IPv4 address. More... | |
virtual bool | OnNameResolvedV6 (const AString &a_Name, const sockaddr_in6 *a_IP) |
Called when the hostname is successfully resolved into an IPv6 address. More... | |
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_IP) override |
Called when the hostname is successfully resolved into an IP address. More... | |
Protected Attributes | |
cLuaState::cTableRefPtr | m_Callbacks |
The Lua table that holds the callbacks to be invoked. More... | |
AString | m_Query |
The query used to start the lookup (either hostname or IP). More... | |
Definition at line 19 of file LuaNameLookup.h.
cLuaNameLookup::cLuaNameLookup | ( | const AString & | a_Query, |
cLuaState::cTableRefPtr && | a_Callbacks | ||
) |
Creates a new instance of the lookup callbacks for the specified query, using the callbacks that are in the specified table.
Definition at line 13 of file LuaNameLookup.cpp.
|
overrideprotectedvirtual |
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 32 of file LuaNameLookup.cpp.
|
overrideprotectedvirtual |
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 41 of file LuaNameLookup.cpp.
|
overrideprotectedvirtual |
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 23 of file LuaNameLookup.cpp.
|
protected |
The Lua table that holds the callbacks to be invoked.
Definition at line 29 of file LuaNameLookup.h.
|
protected |
The query used to start the lookup (either hostname or IP).
Definition at line 32 of file LuaNameLookup.h.