5/7

Simple client

    my $host = '10.0.0.2';
    my $port = 259;
    POE::Component::Client::TCP->new(
	RemoteAddress => $host,
	RemotePort    => $port,
	Filter        => "POE::Filter::Stream",
	Connected     => sub {
	    print "connected to $host:$port\n" if $debug;
	},
	ConnectError  => sub { $_[KERNEL]->delay(reconnect => 60); },
	Disconnected  => sub { $_[KERNEL]->delay(reconnect => 5); },
	ServerInput   => sub {
	    my ($k, $h, $input) = @_[KERNEL, HEAP, ARG0];
	    print "$host:$port Got $input" if $debug;
	    do_input($host, $input, $h->{server}, $h);
	},
    );