Solved

TCP doesn't timeout properly;

Posted on 1998-12-17
7
136 Views
Last Modified: 2010-03-05
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
Comment
Question by:binkzz
  • 4
  • 2
7 Comments
 
LVL 1

Expert Comment

by:flivauda
ID: 1206981
What are you trying to do?
0
 
LVL 4

Author Comment

by:binkzz
ID: 1206982
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
 
LVL 1

Accepted Solution

by:
flivauda earned 100 total points
ID: 1206983
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 4

Author Comment

by:binkzz
ID: 1206984
That's excellent, but as in my question I really need to do this in perl, not shell.
0
 
LVL 5

Expert Comment

by:b2pi
ID: 1206985
perldoc Net::Telnet

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

http://perl.com/cgi-bin/cpan_mod?module=Net::Telnet
0
 
LVL 4

Author Comment

by:binkzz
ID: 1206986
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
 
LVL 4

Author Comment

by:binkzz
ID: 6723437
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now