我一直在使用 Perl 的AnyEvent做一些代理脚本。
Agent<->Proxy-Server<->client
我的程序在此设置中充当代理服务器。
在AnyEvent::Handle中,如何停止从代理读取数据并在客户端获取数据后恢复?
零件代号:
$hdl->on_read(
sub {
my $h = shift;
$h->stop_read;
print $h->rbuf;
$h->push_write("Hello there");
}
);
我最近添加$handle->stop_read
了代理on_read
事件,但这不起作用。代理始终获取数据。