IO::Socket::ByteCounter - Perl extension to track the byte sizes of data in and out of a socket
use IO::Socket::ByteCounter qw('IO::Socket');
use IO::Socket::ByteCounter; ... IO::Socket::ByteCounter->record_bytes('IO::Socket');
... normal IO::Socket::INET object (as $sock) use ... print 'Bytes out: ', $sock->get_bytes_out, "\n"; print 'Bytes in: ', $sock->get_bytes_in , "\n"; print 'Bytes total: ', $sock->get_bytes_total, "\n";
Takes a list of package names (or IO::Socket based objects) for which to turn on byte counting.
Its also creates 3, hopefully, self explanitory methods for the socket in question:
Returns size of strings passed in bytes. Used internally.
Add [m]any methods that need bytes counted.
Daniel Muey, http://drmuey.com/cpan_contact.pl
Copyright (C) 2006 by Daniel Muey
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.