Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

•Re: Multiplexed TCP-Client (from: Networkprogramming with Perl)

by merlyn (Sage)
on Jul 27, 2002 at 15:12 UTC ( [id://185752]=note: print w/replies, xml ) Need Help??


in reply to Multiplexed TCP-Client (from: Networkprogramming with Perl)

Instead of reinventing wheels, I'd take a serious look at POE.

-- Randal L. Schwartz, Perl hacker

  • Comment on •Re: Multiplexed TCP-Client (from: Networkprogramming with Perl)

Replies are listed 'Best First'.
Re: •Re: Multiplexed TCP-Client (from: Networkprogramming with Perl)
by mitd (Curate) on Jul 27, 2002 at 16:57 UTC

    Ahh! the dangers of being a New Age Open Source Duct Tape Folk Hero

    ' So, I rummaged around for the right event loop or RPC package. I figured this was already a frequently-solved problem, so there was no point in reinventing the wheel. I investigated the Event package, POE, most of the stuff in the RPC:: and IPC:: sections of the CPAN, and was astounded to find that nobody had seemed to tackle this particular problem in a way that I wanted it done. Or at least, in a way that I could easily find it.'

    -- Randal L. Schwartz from 'Getting your kids to do the work' Linux Magazine Aug 2000

    and in next months follow up article

    'OK, by the time I did all this, I could have simply used POE or Event, both found in the CPAN. But going through all the reasons that those features are there was a good exercise for me. Sometimes leverage is the right thing, and in hindsight, I might have appreciated it here.'

    -- Randal L. Schwartz from 'A forking parallel link checker' Linux Magazine Sep 2000

    mitd-Made in the Dark -- President merlyn Fan Club Clearview Twp. Chapter
    'Interactive! Paper tape is interactive!
    If you don't believe me I can show you my paper cut scars!'

      Thanks for pointing those out. And especially prophetic, since my upcoming Oct 2002 LM article is about using POE to do that exact problem again, in a much simpler way.

      -- Randal L. Schwartz, Perl hacker

Re: •Re: Multiplexed TCP-Client (from: Networkprogramming with Perl)
by thor (Priest) on Jul 27, 2002 at 15:51 UTC
    ...or he could try to learn something. One does not pick up a book that proposes to teach something without intending to learn it. To that end, this example is comletely justified. "You can't know where you're going if you don't know where you've been" applies here as well. Now, if he was trying to use this as actual code, I'd say use the pre-rolled solution. That's not the impression that I got here.

    thor

      Hello,

      thank you for pointing me to POE, but I'm afraid this is not solving the problem.

      I am new to network programming under Win32, but have got a little bit more experience under Linux or Solaris, esp. with preforking servers and - more in a cargo-cult-manner than with real understanding - POE.

      Some months ago, I played around a little bit with the Multiplexing Server described at How to Write a Chat Server and it was running fine under windows, too.
      Some months ago, I bought the book "Network Programming with Perl", and as I arrived at multiplexing Clients, I thought about writing a client to it (just for fun), threw in the code under Win2k and wondered why it didn't work. I ran it under Linux - no problems. Then I read some documentation again (IO::Select, IO::Socket), and wondered much more.

      This question is not really important for me, but I am very curious how this problem can be solved.

      Best regards,
      perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-18 02:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found