5.16.4. Class SockAddrInetHostname

This class encapsulates a hostname:port or IPv4 address:port pair. Name resolution is only performed when creating the SockAddrInetHostname object (that is, during startup and reload). The class is implemented and exported by the Zorp core. The SockAddrInetHostname Python class serves only documentation purposes, and has no real connection to the behavior implemented in C.

Example 5.43. SockAddrInetHostname example

The following example defines a hostname:port or IPv4 address:port pair.

SockAddrInetHostname('www.example.com', 80)
SockAddrInetHostname('192.168.10.10', 80)

The following example uses SockAddrInetHostname in a dispatcher.

Dispatcher(transparent=TRUE, bindto=DBSockAddr(protocol=ZD_PROTO_TCP, sa=SockAddrInetHostname('www.example.com', 50080)), service="intra_HTTP_inter", backlog=255, rule_port="50080")