EnetAddress

from acron.enet import EnetAddress
class EnetAddress

Bases:

A lightweight value class describing an IPv4 endpoint (host and port), as used by the ENet reliable-UDP library. The host is stored in network byte order, matching ENetAddress.

Inheritance diagram

digraph inheritance84fbbf7d21 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "EnetAddress" [URL="acron.enet.EnetAddress.html#acron.enet.EnetAddress",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "EnetAddress" [arrowsize=0.75,style=""]; }
__eq__()
__init__()

Creates an address from a host name (which may be a dotted-quad IP string or a DNS name) and a port. If the name cannot be resolved, the host part is left as 0 (ENET_HOST_ANY).

__ne__()
get_host()
get_host_name()

Performs a reverse DNS lookup on the address. Falls back to the dotted IP string if the lookup fails. Note that this may block on network traffic.

get_ip_string()

Returns the address as a dotted-quad IP string, e.g. “127.0.0.1”.

get_port()
property host → int
property ip_string → string

Returns the address as a dotted-quad IP string, e.g. “127.0.0.1”.

output()
property port → int
set_host()
set_host_name()

Resolves the given host name (dotted-quad IP string or DNS name) and stores the result. Returns true on success, false if resolution failed.

set_port()