On Jul 27, 10:07 am, siegfr...@heintze.com wrote: > Sorry if this appears twice. Since it bounced back to me -- probably > because of the HTML format -- I'm sending it again. > > I did some google searching and I could not find an example of a > bidirectional asynchronous socket client. A telnet client is an example > of a bidirectional asynchronous socket client. > > I don't specifically want source to a telnet client -- that would be > much fancier than what I require and would not be helpful if the perl > only called C++. I just want an example in pure perl (or ruby or > python). > > By asynchronous I mean that reads and writes can occur at any time in > any order with no warning. > > Asynchronous could also mean that we don't block while the write is in > progress. Blocking while the write is in progress is fine. > > I hope it is possible to write such a beast in perl. > > Let's suppose I spawn two threads, one to block on a read socket and the > other to block on the keyboard with $inp=<STDIN> (so it can print to the > write socket when it receives input form the keyboard). Can the first > thread print to the console if the second thread is blocking on > $inp=<STDIN>? > > Surely, someone has posted source to such a beast somewhere on the > internet!
Although I don't have experience with it., POE ( http://poe.perl.org) offers extensive resources for this type of application including tutorials, sample cookbook programs, etc.: >From the POE page above: POE is a Perl framework for writing reactive programs. Cooperatively multitasked programs and networking programs are overlapping subsets of reactive programs. POE implements a single API and bridges from it to other event loops. A program using POE can run under any event loop that POE supports, with little or no modification. -- Charles DeRykus -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/