Ah ha,

A documentation bug,  In perldoc POE::Component::Client::TCP

       Filter
       ....
       For example, this changes the line separator to a vertical pipe:

           Filter => [ "POE::Filter::Line", InputLiteral => "|" ],

Should be:

           Filter => [ "POE::Filter::Line", Literal => "|" ],

Jay


>
> Rocco,
>
> I did it the way you said (e.g. with a Wheel::ReadWrite &
POE::Filter::Line)
> and that works.  The initial part of the conversation goes:
> connect
> send clientVersion number
> receive serverVersion number
> send clientID
>
> For grins (cause David suggested it) I tried with Component::Client::TCP,
> but now it doesn't seem to call serverInput.  I can't see my problem.  Can
> someone point to my error?
>
> Thanks
> Jay
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
> use POE qw(Component::Client::TCP);
>
> $|++;
>
> POE::Component::Client::TCP->new(
>         RemoteAddress => "localhost",
>         Filter        => [ "POE::Filter::Line", InputLiteral => "\0" ],
>         RemotePort    => 11001,
>         Connected     => \&connected,
>         ConnectError  => \&connectError,
>         Disconnected  => \&disconnected,
>         ServerInput   => sub {
>                 my $input = $_[ARG0];
>                 print "from server: $input\n";
>         },
>         ServerError   => \&serverError,
> );
>
> $poe_kernel->run();
>
> sub connected {
>         my ($heap) = @_[HEAP, ARG0];
>         print "connected\n";
>         my $clientVersion = 10;
>         $heap->{server}->put($clientVersion);
> }
>
>
>

Reply via email to