raybies has asked for the wisdom of the Perl Monks concerning the following question:

I've a friend who asked me how to speed up his net::telnet connection, and I figured I'd come here and ask... Apparently he uses this package on a Win32 machine to connect to a vax emulator, and when it goes to connect it takes upwards of fifteen seconds to connect. He was wondering if the Net::Telnet could be sped up, seeing as how when he uses regular telnet from the command prompt, it has an immediate response.

Just Curious where to look or what might be going on underneath the hood.

Replies are listed 'Best First'.
Re: Net::Telnet response speedup
by jethro (Monsignor) on Feb 01, 2011 at 13:21 UTC

    It shouldn't take 15s to connect. Your friend should read the section "Debugging" in Net::Telnet to turn on a debug log. And/or use a network sniffer to obverse the network packages and find out where the 15 seconds are wasted.

    Also if you want specific answers, posting the source code would help tremendously

Re: Net::Telnet response speedup
by cjb (Friar) on Feb 01, 2011 at 13:44 UTC

    If the 15sec delay is only on connect, then there is a good chance the telnet server is doing an Reverse DNS lookup on the clients IP address, and timing out. If your friend has control of the machine the server is running on he could turn this feature off, or if he has control of the reverse DNS for the IP address he is connecting from he could ensure this returns a valid record.

Re: Net::Telnet response speedup
by raybies (Chaplain) on Feb 03, 2011 at 21:19 UTC

    Followup: Thought I'd post the solution.

    Using a wireshark they were able to look up the return packets that the vax emulator was sending out. Turns out it was sending out requests asking what sort of Terminal perl was... it would then time out, resend the request, and double the time out (4+8 seconds delayed...)...

    they ended up turning off that feature on the server side, something about a sysconfig block setting (I'm not a vme lover... I didn't get the exact command), though I suppose you could have Net::Telnet send the terminal type back... which caused the system to no longer delay.

    --Ray