Defined in file: hzIpServer.h

hzIpListen is a hzIpServer support class. It holds a listening socket and port, various control parameters and pointers to the OnIngress(), OnConnect() and OnDisconn() functions used to handle client connections.

Constructors/Detructors

hzIpListen*hzIpListen(hzLogger* plog)
NULL-TYPEhzIpListen(hzLogger* plog)
void~hzIpListen(void)
NULL-TYPE~hzIpListen(void)

Public Methods:

hzEcodeActivate(void)Purpose: Acivate listening socket. This creates a sock and then binds it to a port. .
uint32_tGetActConn(void)
hzLogger*GetLogger(void)
uint32_tGetMaxConn(void)
uint32_tGetPort(void)
hzIpServer*GetServer(void)
const char*GetSockFile(void)
uint32_tGetSocket(void)
uint32_tGetTimeout(void)
hzEcodeInitINET(hzIpServer* pServer)hzTcpCode(*)(hzChain&,hzIpConnex*) OnIngress, hzTcpCode(*)(hzIpConnex*) OnConnect, hzTcpCode(*)(hzIpConnex*) OnDisconn, uint32_t nTimeout, uint32_t nPort, uint32_t nMaxConn, uint32_t bOpflags, Purpose: Initialize a listening socket.
hzEcodeInitUNIX(hzIpServer* pServer)hzTcpCode(*)(hzChain&,hzIpConnex*) OnIngress, hzTcpCode(*)(hzIpConnex*) OnConnect, hzTcpCode(*)(hzIpConnex*) OnDisconn, const char* sockFile, uint32_t nTimeout, uint32_t nMaxConn, uint32_t bOpflags, Purpose: Initialize a listening socket.
uint16_tOpflags(void)
boolUseSSL(void)
boolUseUDP(void)
boolUseUNIX(void)

Member Variables:

sockaddr_inm_AddressIP Addres of socket
hzTcpCode(*)(hzIpConnex*)m_OnConnectOnly for protocols in which the server sends the first message (server hello).
hzTcpCode(*)(hzIpConnex*)m_OnDisconnOnly provided if extra tidying up is needed on dissconnection.
hzTcpCode(*)(hzChain&,hzIpConnex*)m_OnIngressTo be called as soon as input exists.
hzStringm_SockFileFor AF_UNIX sockets
sockaddr_unm_UnixIP Addres of socket
void*m_appFnCast to the specific callback function (eg HTTP)
uint16_tm_bOpflagsOperational flags (HZ_LISTEN_SECURE | HZ_LISTEN_INTERNET | HZ_LISTEN_UDP)
uint16_tm_nActConnCurrent number of simultaneous TCP connections on this port
uint16_tm_nMaxConnMax number of simultaneous TCP connections on this port
uint16_tm_nPortPort number server listens on
uint32_tm_nSocketThe actual listening socket
uint32_tm_nTimeoutTimeout appllied to all connections to this port
hzLogger*m_pLogLog channel
hzIpServer*m_pServerApplicable hzIpServer instance