- * Queue child id answer nextserver sentudp senttcp
- * tosend null >=0 null any any any
- * timew null >=0 null any at least 1 bit set any
- * childw set >=0 partial any any any
- * output null -1 set/null any any any
+ *
+ * state Queue child id answer nextudpserver sentudp failedtcp
+ *
+ * udp NONE null >=0 null 0 zero zero
+ * udp timew null >=0 null any nonzero zero
+ * udp NONE null >=0 null any nonzero zero
+ *
+ * tcpwait timew null >=0 null irrelevant zero any
+ * tcpsent timew null >=0 null irrelevant zero any
+ *
+ * child childw set >=0 partial irrelevant irrelevant irrelevant
+ * done output null -1 set/null irrelevant irrelevant irrelevant
+ *
+ * +------------------------+
+ * START -----> | udp/NONE |
+ * +------------------------+
+ * / |\ \
+ * too big for UDP / UDP timeout \ \ send via UDP
+ * do this ASAP! / more retries \ \ do this ASAP!
+ * |_ desired \ _|
+ * +---------------+ +-----------+
+ * | tcpwait/timew | ____ | udp/timew |
+ * +---------------+ \ +-----------+
+ * | ^ | | |
+ * TCP conn'd; | | TCP died | | |
+ * send via TCP | | more | UDP timeout | |
+ * do this ASAP! | | servers | no more | |
+ * v | to try | retries | |
+ * +---------------+ | desired | |
+ * | tcpsent/timew | ____ | | |
+ * +---------------+ \| | |
+ * \ \ TCP died | TCP | |
+ * \ \ no more | timeout / |
+ * \ \ servers | / |
+ * \ \ to try | / |
+ * got \ \ v |_ / got
+ * reply \ _| +------------------+ / reply
+ * \ | done/output FAIL | /
+ * \ +------------------+ /
+ * \ /
+ * _| |_
+ * (..... got reply ....)
+ * / \
+ * need child query/ies / \ no child query
+ * / \
+ * |_ _|
+ * +--------------+ +----------------+
+ * | child/childw | ----------------> | done/output OK |
+ * +--------------+ children done +----------------+