When multiple instances of Anetd are running (under different OS accounts), only one such instance may be listening on the default Anetd port (3322) (for any one network interface), and that instance (if it exists) is the primary Anetd instance. Other instances are considered secondary. To execute a command on a secondary Anetd, either the client must send the command directly to the port on which the secondary is listening, or the primary must forward the command to the secondary. Forwarding can be done either explicitly or implicitly in Anetd version 1.4 or higher.
Forwarding to secondary daemons increases response time. In order to improve performance, the daemon responding to a client's request includes the port number on which it is listening in the acknowledgement message. This allows a client to learn the port number after the first request and subsequently use that port to directly communicate with the secondary daemon without the additional forwarding delay. This port-mapping feature can be used in those cases in which performance is critical but can be ignored for normal operation.
$ sc -f abocc d04 QUERY text/ancors: firstname.lastname@example.org:3322->8000 DEVEL bsd44 anetd_uptime 1:01:25:34 $ sc d04:8000 QUERY text/ancors: email@example.com:3322->8000 DEVEL bsd44 anetd_uptime 1:01:25:48
In the first sc invocation we ask the primary Anetd on node d04 to forward our command, QUERY, to the secondary Anetd running in the ABone role abocc. The reply we get comes from that secondary Anetd. Among other things we see the port number the secondary is listening, port 8000.
In the second sc invocation we send the QUERY command directly on port 8000, obtaining exaclty the same reply.