Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 160
  • Last Modified:

TCP doesn't timeout properly;

neither can i get information before the buffer runs over.

Is there any way in perl I can get input by the character rather than by the buffer?

Tom
0
binkzz
Asked:
binkzz
  • 4
  • 2
1 Solution
 
flivaudaCommented:
What are you trying to do?
0
 
binkzzAuthor Commented:
I'm actually trying to connect to several servers on the telnet port, basically read in anything until the login: and then disconnect.

This way I can check the virtual server's handshakes.
0
 
flivaudaCommented:
you can use and expect script:


#!/usr/bin/expect

set timeout 1200

spawn telnet hostname.domain

expect {
  "login:" { exit; }
}


then run it like this:

% myexpect.ex > logfile

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
binkzzAuthor Commented:
That's excellent, but as in my question I really need to do this in perl, not shell.
0
 
b2piCommented:
perldoc Net::Telnet

or, if you don't have that...

http://perl.com/cgi-bin/cpan_mod?module=Net::Telnet
0
 
binkzzAuthor Commented:
I've got Net::Telnet, that'll time me out and send/recieve data, but it won't actually send me what I need.

I'm currently modifying the Telnet.pm module so it will do what I want it to do. :/

Thanks flivaudaa for your efforts, here's a well deserved 100 points.

Bink
0
 
binkzzAuthor Commented:
I'm trying to check different server's handshakes, and have the script do different things, dependant on the results.

Mr B
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now