Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Net::Telnet problems

by hatter (Pilgrim)
on May 08, 2002 at 10:28 UTC ( #164972=note: print w/replies, xml ) Need Help??


in reply to Net::Telnet problems

If you read for input with zero timeout, and then only try and process the data if there's anything to be processed, then the loop will run through both options, regardless of whether there's data on both inputs or not. Don't forget to add in something to stop it looping at high speed, though, or it'll eat all your CPU while it's not doing anything.

An alternative solution is to fork off a process for each tcp connection you're making, as you don't appear to be doing any cross communication between the two in your example code. That way you can wait indefinately on input still.

the hatter

Replies are listed 'Best First'.
Re: Re: Net::Telnet problems
by Anonymous Monk on May 08, 2002 at 21:11 UTC
    If I read for input with zero timeout, the program immediately quits, saying: read timed-out at bot.pl line 29

    I can't use a different process, because I intend to include cross communication in the future.

    Thanks,
    Anonymous Monk

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://164972]
help
Chatterbox?
[marto]: good morning all
[Corion]: Hi marto!
[choroba]: Good morning!
[Corion]: I hope you had a good weekend!
[marto]: jetlag has really done a number on the kids, it's been a tough week

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (10)
As of 2018-06-25 08:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (126 votes). Check out past polls.

    Notices?