I don't think the F_GETFL or F_SETFL warnings are part of your current problem. See Re^5: sending data over TCP channel using POE::Component::Server::TCP on this. I've tested the following example under windows and unix (various). It still works even with the warning messages under windows.
I've been asking for so much help on POE stuff lately, here is what I can give back. Hope it helps.
-Craig
use strict; use warnings; use Tk; # This MUST come before use POE... use POE; use POE::Component::Client::TCP; use Data::Dumper; # This connects to the ssh port on the local machine (modify as requir +ed)... my $host = 'localhost'; my $port = '22'; my $textw; # Global for text widget _processData(); _displayData(); print STDERR "STARTING to process data...\n"; POE::Kernel->run; exit; sub _processData{ POE::Component::Client::TCP->new( RemoteAddress => $host, RemotePort => $port, Filter => "POE::Filter::Line", Alias => 'myClient', Connected => sub { $textw->insert(end=>"connected to $host:$port ...\n"); $textw->update; }, ConnectError => sub { $textw->insert(end=>"no connection to $host:$port. Reconne +cting in 5...\n"); $textw->update; $_[KERNEL]->delay( reconnect =>5 ); }, ServerInput => sub { my $input = $_[ARG0]; $_[KERNEL]->post(Display=>data=>$input); }, ); } sub _displayData{ POE::Session->create( inline_states => { _start => sub { my $kern = $_[KERNEL]; $kern->alias_set("Display"); my $top = $poe_main_window; my $sess=$kern->alias_resolve('myClient') || die("Can't resolve myClient"); $textw = $top->Scrolled('Text', -scrollbars=>'osow', -wrap=>'none')-> pack(-fill=>'both',-side=>'left', -expand=>1); }, data=>sub{ $textw->insert(end=>$_[ARG0] . "\n"); $textw->update; }, }); }
In reply to Re^3: POE Multitasking Client/Server
by cmv
in thread POE Multitasking Client/Server
by muthuma
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |