Solved

TCP doesn't timeout properly;

Posted on 1998-12-17
7
142 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 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
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!

 
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

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Reading fields from the text file. 4 105
Using Perl to parse rows 7 107
Replace  text in a file 2 128
Perl regex to replace any capital letters not preceded by ">" 6 177
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…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
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…

734 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