5.16.2. Class SockAddrInet

This class encapsulates an IPv4 address:port pair, similarly to the sockaddr_in struct in C. The class is implemented and exported by the Zorp core. The SockAddrInet Python class serves only documentation purposes, and has no real connection to the behavior implemented in C.

Example 5.39. SockAddrInet example

The following example defines an IPv4 address:port pair.

SockAddrInet('192.168.10.10', 80)

The following example uses SockAddrInet in a dispatcher.

Dispatcher(transparent=TRUE, bindto=DBSockAddr(protocol=ZD_PROTO_TCP, sa=SockAddrInet('192.168.11.11', 50080)), service="intra_HTTP_inter", backlog=255, rule_port="50080")