Solved

TCP doesn't timeout properly;

Posted on 1998-12-17
7
137 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
cpan issue 1 61
How to have Regular expression keep first 14 characters and start changes at character 15 or beyond 2 93
Perl 101 11 72
Perl script not writing to .csv file 6 106
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…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

910 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

23 Experts available now in Live!

Get 1:1 Help Now