ac:inbound_session_count — Return the current inbound session count to this listener for the connecting IP
cidr: string (optional) service_type: string (optional)
ac is an accept construct userdata data type. For a description of the C struct see accept_construct.
If called with no arguments, this function returns the current inbound session count to this listener for the connecting IP. Otherwise it returns the count for the defined IP or CIDR. It is used as shown below:
local count = ac:inbound_session_count("localhost/32");
If called with one argument, that argument should be in one of the following forms:
/24evaluates to connecting IP/24
/32evaluates to exactly the connecting IP
addr/maskevaluates to a specific address and mask
addrevaluates to a specific address
This feature supports IPv6.
IPv6 addresses are much more flexible than IPv4 addresses in terms of their formatting options. They also use a different delimiter character than IPv4 addresses (a colon instead of a period). This means that in certain contexts, an IPv6 address can create parsing ambiguities.
The accepted convention is to require that, in circumstances where a configuration parameter can also contain something other than an IP address, that an IPv6 address must be enclosed in square brackets. In practical terms, this means that things like the
listen options must have IPv6 addresses enclosed in brackets. Others, such as
prohibited_hosts do not require the IPv6 address in brackets.
The second argument returns the count for the specified service type. Service types are:
ECmmove2 (The service that handles duravip message moves.)
Service type names are case sensitive. If no type is specified, the default is
SMTP. If you wish to specify the second parameter only, call this function in the following way:
local count = ac:inbound_session_count(nil, "Control");.