Click here to get back home

POE::Component::Client::TCP help!

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
POE::Component::Client::TCP help! Greg G 02-07-2005
Get Chitika Premium
Posted by Greg G on February 7, 2005, 12:11 pm
Please log in for more thread options

I'm trying to use POE::Component::Client::TCP to simulate some telnet
sessions. I get a good connect (my connection callback is triggered,
and I can see the connection at the OS level), but I can't seem to send
any data.



I'm doing something like this:

my @sendthis ("username","password","command","exit");
$heap->->put (@sendthis);

But nothing seems to happen. Frankly, I'm confused as to how this could
work, since the heap is shared between sessions.


I've also tried using $poe_kernel->post, but I can't figure out what the
first parameter is supposed to be. I don't have the alias locally, and
I can't seem to extract the peer address from the args.

Any ideas?

-Greg G


Posted by Rocco Caputo on February 8, 2005, 6:43 am
Please log in for more thread options
On Mon, 07 Feb 2005 11:11:02 -0500, Greg G wrote:
>
> I'm trying to use POE::Component::Client::TCP to simulate some telnet
> sessions. I get a good connect (my connection callback is triggered,
> and I can see the connection at the OS level), but I can't seem to send
> any data.
>
> I'm doing something like this:
>
> my @sendthis ("username","password","command","exit");
> $heap->->put (@sendthis);
>
> But nothing seems to happen. Frankly, I'm confused as to how this could
> work, since the heap is shared between sessions.

This is odd. Each session is assigned its own heap, and it is passed
to your callbacks as $_[HEAP] (the HEAPth element of @_). If you find
that all your heaps are shared, then you may not be using the
component correctly. More could would provide valuable context here.

> I've also tried using $poe_kernel->post, but I can't figure out what the
> first parameter is supposed to be. I don't have the alias locally, and
> I can't seem to extract the peer address from the args.
>
> Any ideas?

It would help to see just how you're doing this.

--
Rocco Caputo - http://poe.perl.org/


Posted by Greg G on February 8, 2005, 4:03 pm
Please log in for more thread options


Rocco Caputo wrote:

> On Mon, 07 Feb 2005 11:11:02 -0500, Greg G wrote:
>
>>I'm trying to use POE::Component::Client::TCP to simulate some telnet
>>sessions. I get a good connect (my connection callback is triggered,
>>and I can see the connection at the OS level), but I can't seem to send
>>any data.
>>
>>I'm doing something like this:
>>
>>my @sendthis ("username","password","command","exit");
>>$heap->->put (@sendthis);
>>
>>But nothing seems to happen. Frankly, I'm confused as to how this could
>>work, since the heap is shared between sessions.
>
>
> This is odd. Each session is assigned its own heap, and it is passed
> to your callbacks as $_[HEAP] (the HEAPth element of @_). If you find
> that all your heaps are shared, then you may not be using the
> component correctly. More could would provide valuable context here.

They are? Hmmm. I'm wondering if I'm not having some weird deal
where the sessions are getting the same ID.........Yep. $session->ID
are all reporting "2". Now I'm *really* confused. I'm definately
giving a distinct alias to each session "telnet_$hostname". Distinct
aliases were how I made P:C:SNMP give me distinct session IDs, but I'm
not sure what the mechanism is that assigns them.

>>I've also tried using $poe_kernel->post, but I can't figure out what the
>>first parameter is supposed to be. I don't have the alias locally, and
>>I can't seem to extract the peer address from the args.
>>
>>Any ideas?
>
> It would help to see just how you're doing this.

I've abandonded this a bit to try to mix together a
Poe:Component:Telnet. I'm pretty close, but I seem to be having a
problem with the session ID. Go figure. The POE documentation isn't
making much sense to me, either.

More soon.

Thanks.

-Greg G


Similar ThreadsPosted
POE-Component-PSD May 11, 2007, 12:58 pm
ANNOUNCE: POE-Component-GCS May 11, 2007, 12:42 pm
POE::Component::IRC::State and nick changes November 9, 2007, 6:04 pm
ANNOUNCEMENT: POE 0.32, an event driven component framework August 6, 2005, 4:29 pm
soaplite server and .net client September 14, 2006, 9:04 pm
Determine NT domain username of web client February 3, 2005, 4:24 pm
Sockets - client unable to connect May 1, 2006, 5:28 pm
beginner question on use of Frontier::Client November 15, 2006, 10:52 am
namespace for iTunes Connect client module? November 10, 2008, 9:38 pm
Writing a HTML/ASP SOAP client for a SOAP::Lite destination March 16, 2005, 5:19 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap