Cuberite
A lightweight, fast and extensible game server for Minecraft
IPLookup.h
Go to the documentation of this file.
1 
2 // IPLookup.h
3 
4 // Declares the cIPLookup class representing an IP-to-hostname lookup in progress.
5 
6 // This is an internal header, no-one outside OSSupport should need to include it; use Network.h instead
7 
8 
9 
10 
11 
12 #pragma once
13 
14 #include "Network.h"
15 
16 
17 
18 
19 
21 class cIPLookup
22 {
23 public:
24 
26  static void Lookup(const AString & a_IP, cNetwork::cResolveNameCallbacksPtr a_Callbacks);
27 
28 protected:
29 
32 
35 
37  cIPLookup(const AString & a_IP, cNetwork::cResolveNameCallbacksPtr a_Callbacks);
38 
40  void Callback(int a_Result, const char * a_Address);
41 };
42 typedef std::shared_ptr<cIPLookup> cIPLookupPtr;
43 typedef std::vector<cIPLookupPtr> cIPLookupPtrs;
44 
45 
46 
47 
48 
std::shared_ptr< cIPLookup > cIPLookupPtr
Definition: IPLookup.h:42
std::vector< cIPLookupPtr > cIPLookupPtrs
Definition: IPLookup.h:43
std::string AString
Definition: StringUtils.h:11
Holds information about an in-progress IP-to-Hostname lookup.
Definition: IPLookup.h:22
cIPLookup(const AString &a_IP, cNetwork::cResolveNameCallbacksPtr a_Callbacks)
Creates the lookup object.
Definition: IPLookup.cpp:19
void Callback(int a_Result, const char *a_Address)
Callback that is called by LibEvent when there's an event for the request.
Definition: IPLookup.cpp:68
AString m_IP
The IP that was queried (needed for the callbacks).
Definition: IPLookup.h:34
cNetwork::cResolveNameCallbacksPtr m_Callbacks
The callbacks to call for resolved names / errors.
Definition: IPLookup.h:31
static void Lookup(const AString &a_IP, cNetwork::cResolveNameCallbacksPtr a_Callbacks)
Creates a lookup object and schedules the lookup.
Definition: IPLookup.cpp:30
std::shared_ptr< cResolveNameCallbacks > cResolveNameCallbacksPtr
Definition: Network.h:309