Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Re: Re: non-blocking TCP/IP client object using callbacks

by Mr_Person (Hermit)
on Jul 22, 2003 at 14:57 UTC ( [id://276752]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: non-blocking TCP/IP client object using callbacks
in thread non-blocking TCP/IP client object using callbacks

Actually, POE should work just great as a telnet client. Here's an example of a simple "port scanner" that shows how easy it is to make a TCP client with POE::Component::Client::TCP. There are a lot more useful examples at the POE Cookbook. Also, since POE is event based it will do exactly what you were wanting as far as passing the messages to whatever subroutine you want via callback.

It may take a little while to get used to writing programs with POE, but I highly recommend it! It is much simpler than threads and you don't have to worry about IPC like you would with forking because it's all the same process.

  • Comment on Re: Re: Re: non-blocking TCP/IP client object using callbacks

Replies are listed 'Best First'.
Re: POE
by jettero (Monsignor) on Jul 22, 2003 at 16:35 UTC
    Yes, ... I forced myself to go read more about this POE. At first it looked like just the Latest Thing, but after further reading ...

    I think poe::component::client::tcp precisely what I was asking about without knowing how to ask about it. I'm going to try it out and see if it's really what I was hoping for.

    update: It LOOKED like what I wanted, but I can't figure out how to call _both_ the MainLoop for Curses::UI AND the run() for the POE object...

    I'm convinced there's a way to do it... but I don't yet see it.

    update: No. This is wrong. It could possibly be made to work, but it's giant, speaks it's own language, and doesn't really do what I want at all. Now I'm back to square one... I may not use IPC::SysV though. There's a lot of stuff on the perlipc manpage.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://276752]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-25 22:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found