Permalink
Browse files

added poe script

  • Loading branch information...
1 parent e6d5f98 commit 5eb2fa27a636d6dd5431f9378894a37ac174def9 @tokuhirom committed Sep 23, 2009
Showing with 25 additions and 0 deletions.
  1. +25 −0 echo-poe.pl
View
@@ -0,0 +1,25 @@
+use warnings;
+use strict;
+use POE;
+use POE::Component::Server::TCP;
+use Getopt::Long;
+
+my $port = 9010;
+my $concurrent = 10;
+GetOptions(
+ 'port=i' => \$port,
+ 'concurrent=i' => \$concurrent,
+);
+POE::Component::Server::TCP->new(
+ Port => $port,
+ ClientInput => sub { $_[HEAP]->{client}->put( $_[ARG0] ); },
+ ClientFilter => [ "POE::Filter::Line", Literal => "\x0a" ],
+ Address => '0.0.0.0',
+ Concurrency => $concurrent,
+);
+
+print "$0: http://localhost:$port/\n";
+print "concurrent: $concurrent\n";
+POE::Kernel->run;
+exit;
+

0 comments on commit 5eb2fa2

Please sign in to comment.