Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <Network.h>
Classes | |
class | cConnectCallbacks |
Callbacks used for connecting to other servers as a client. More... | |
class | cListenCallbacks |
Callbacks used when listening for incoming connections as a server. More... | |
class | cResolveNameCallbacks |
Callbacks used when resolving names to IPs. More... | |
Public Types | |
typedef std::shared_ptr< cConnectCallbacks > | cConnectCallbacksPtr |
typedef std::shared_ptr< cListenCallbacks > | cListenCallbacksPtr |
typedef std::shared_ptr< cResolveNameCallbacks > | cResolveNameCallbacksPtr |
Static Public Member Functions | |
static bool | Connect (const AString &a_Host, UInt16 a_Port, cConnectCallbacksPtr a_ConnectCallbacks, cTCPLink::cCallbacksPtr a_LinkCallbacks) |
Queues a TCP connection to be made to the specified host. More... | |
static cUDPEndpointPtr | CreateUDPEndpoint (UInt16 a_Port, cUDPEndpoint::cCallbacks &a_Callbacks) |
Opens up an UDP endpoint for sending and receiving UDP datagrams on the specified port. More... | |
static AStringVector | EnumLocalIPAddresses (void) |
Returns all local IP addresses for network interfaces currently available. More... | |
static bool | HostnameToIP (const AString &a_Hostname, cResolveNameCallbacksPtr a_Callbacks) |
Queues a DNS query to resolve the specified hostname to IP address. More... | |
static bool | IPToHostName (const AString &a_IP, cResolveNameCallbacksPtr a_Callbacks) |
Queues a DNS query to resolve the specified IP address to a hostname. More... | |
static cServerHandlePtr | Listen (UInt16 a_Port, cListenCallbacksPtr a_ListenCallbacks) |
Opens up the specified port for incoming connections. More... | |
typedef std::shared_ptr<cConnectCallbacks> cNetwork::cConnectCallbacksPtr |
typedef std::shared_ptr<cListenCallbacks> cNetwork::cListenCallbacksPtr |
typedef std::shared_ptr<cResolveNameCallbacks> cNetwork::cResolveNameCallbacksPtr |
|
static |
Queues a TCP connection to be made to the specified host.
Calls one the connection callbacks (success, error) when the connection is successfully established, or upon failure. The a_LinkCallbacks is passed to the newly created cTCPLink. Returns true if queueing was successful, false on failure to queue. Note that the return value doesn't report the success of the actual connection; the connection is established asynchronously in the background. Implemented in TCPLinkImpl.cpp.
Definition at line 719 of file TCPLinkImpl.cpp.
|
static |
Opens up an UDP endpoint for sending and receiving UDP datagrams on the specified port.
If a_Port is 0, the OS is free to assign any port number it likes to the endpoint. Returns the endpoint object that can be interacted with.
Definition at line 620 of file UDPEndpointImpl.cpp.
|
static |
Returns all local IP addresses for network interfaces currently available.
Definition at line 91 of file NetworkInterfaceEnum.cpp.
|
static |
Queues a DNS query to resolve the specified hostname to IP address.
Calls one of the callbacks when the resolving succeeds, or when it fails. Returns true if queueing was successful, false if not. Note that the return value doesn't report the success of the actual lookup; the lookup happens asynchronously on the background. Implemented in HostnameLookup.cpp.
Definition at line 125 of file HostnameLookup.cpp.
|
static |
Queues a DNS query to resolve the specified IP address to a hostname.
Calls one of the callbacks when the resolving succeeds, or when it fails. Returns true if queueing was successful, false if not. Note that the return value doesn't report the success of the actual lookup; the lookup happens asynchronously on the background. Implemented in IPLookup.cpp.
Definition at line 91 of file IPLookup.cpp.
|
static |
Opens up the specified port for incoming connections.
Calls an OnAccepted callback for each incoming connection. A cTCPLink with the specified link callbacks is created for each connection. Returns a cServerHandle that can be used to query the operation status and close the server. Implemented in ServerHandleImpl.cpp.
Definition at line 371 of file ServerHandleImpl.cpp.