ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/eg/listen
(Generate patch)

Comparing AnyEvent/eg/listen (file contents):
Revision 1.2 by elmex, Sat May 24 17:06:10 2008 UTC vs.
Revision 1.3 by root, Sat May 24 23:34:28 2008 UTC

22 on_error => sub { print "Client connection error: $host:$port: $!\n" } 22 on_error => sub { print "Client connection error: $host:$port: $!\n" }
23 ); 23 );
24 24
25 $hdl->push_write ("Hello!\015\012"); 25 $hdl->push_write ("Hello!\015\012");
26 26
27 $hdl->push_read_line (sub { 27 $hdl->push_read (line => sub {
28 my (undef, $line) = @_; 28 my (undef, $line) = @_;
29 print "Yay, got line: $line\n"; 29 print "Yay, got line: $line\n";
30 $hdl->push_write ("Bye\015\012"); 30 $hdl->push_write ("Bye\015\012");
31 $hdl->on_drain (sub { $hdl->fh->close; undef $hdl }); 31 $hdl->on_drain (sub { $hdl->fh->close; undef $hdl });
32 }); 32 });

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines