2

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.

simbabque
  • 53,749
  • 8
  • 73
  • 136
Prosessor
  • 21
  • 1

0 Answers0