?
Solved

TCP doesn't timeout properly;

Posted on 1998-12-17
7
Medium Priority
?
146 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 300 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
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!

 
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

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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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…
Six Sigma Control Plans
Suggested Courses

752 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