Skip to content

Instantly share code, notes, and snippets.

@mizzy
Created April 9, 2013 08:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mizzy/5343944 to your computer and use it in GitHub Desktop.
Save mizzy/5343944 to your computer and use it in GitHub Desktop.
use AnyEvent::Socket;
use AnyEvent::Handle;
my $cv = AE::cv;
tcp_server undef, 8000, sub {
my $hdl;
$hdl = AnyEvent::Handle->new(
fh => shift,
on_read => sub {
$hdl->push_write(delete $hdl->{rbuf});
},
on_eof => sub {},
);
};
$cv->recv;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment