muthuma-

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.