I've been doing some proxy script using Perl's AnyEvent.
Agent<->Proxy-Server<->client
My program acts as the proxy server in this setup.
In AnyEvent::Handle, How can I stop reading data from the agent and resume after client gets the data?.
Part code:
$hdl->on_read(
sub {
my $h = shift;
$h->stop_read;
print $h->rbuf;
$h->push_write("Hello there");
}
);
I recently added $handle->stop_read
in agent on_read
event but that doesn't work. The agent always get the data.