Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re^2: function to count pending packets in TCP socketby Anonymous Monk |
on Feb 09, 2018 at 13:13 UTC ( [id://1208822]=note: print w/replies, xml ) | Need Help?? |
The ss utility comes from iproute2 package. Sources are freely available for you to read and inspect. The utility is specific to Linux networking. Send-Q is obtained either via netlink(7), or parsing /proc/net/tcp (hexadecimal field named tx_queue). You could do the same in perl program: use getpeername and match the right line. Inefficient and cumbersome, but it might suit your purposes. Lastly, I would reconsider the approach of building HA/failover capabilities directly into application. Perhaps your questions are better answered on a networking related forum. HAProxy dot org for instance has a mailing list and archive. HtH.
In Section
Seekers of Perl Wisdom
|
|