in reply to Overriding/extending IO::Socket::INET methods
I also did implement an IO::Socket variation that limits the throughput to an arbitrary number of bytes per second. The problem I face is, that while it is quite easy to implement a subclass of IO::Socket, it dosen't work if any part of the program uses the filehandle instead of the object methods - and HTTP::Daemon does just that. You can pass the accept() method of HTTP::Daemon the name of the socket subclass you want created, but it won't get you far until you create a tied subclass that behaves like a filehandle.
perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
|
---|