Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
any help is appreciated#!/usr/bin/perl use strict; use warnings; use POE; use POE::Component::Client::TCP; use POE::Filter::Stream;; my $port = 4853; # The port to connect to. my $host = "someserver"; # The host to test. POE::Component::Client::TCP->new ( RemoteAddress => $host, RemotePort => $port, Filter => "POE::Filter::Stream", Connected => \&on_connect, ServerInput => \&on_recieve, ); sub on_connect { print "connected to $host:$port ...\n"; $_[HEAP]->{server}->put('thepassword'); } sub on_recieve { my ( $kernel, $heap, $input ) = @_[ KERNEL, HEAP, ARG0 ]; print $input; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: poe tcp client
by matija (Priest) on Jun 12, 2004 at 17:10 UTC | |
by Anonymous Monk on Jun 12, 2004 at 17:22 UTC |