Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (23 sloc) 616 Bytes
use warnings;
use strict;
use POE;
use POE::Component::Server::TCP;
use Getopt::Long;
use POE::XS::Queue::Array; # this enhancments performance
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;