List Info

Thread: Net::Telnet Timeout




Net::Telnet Timeout
country flaguser name
United States
2007-08-02 16:24:16

Im seeking clarification on how the timeout works in reads within Net::Telnet. Consider this code snippet.

        ##

        ## Use getline to get switch response. Times out on last line; no newline

        ##

        $t->print("show output");

        while ($result = $t->getline(Errmode => "return"))

        {

                print DMPFILE "$result";

        }

        $result = $t->errmsg;

        if ($result eq "read timed-out")

        {

                $result = $t->get(Timeout => 3);     ;   ## Get end of read block without newline

                print DMPFILE "$resultn";

        }

        else

        {

                print DMPFILE "Getline error message = $resultn";

                exit(102);

        }

If I have the default 10 second timeout, does it apply to each getline() or does it apply to the time required for the total response to the show output command. When the application is created it will be interfacing with a telecommunications switch and will be requesting data. Due to the size of the data and slow communications link it will take a long time for the command to complete. I want to design the most effective means to recognize true timeouts, but I need to allow for the inherent slowness of communicating with the switch.

Any experience in this area is welcome.

Steve

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )