Measuring time of a telnet connect

F

Fabian Lanze

Hi!

I want to realize the following: I want to measure the time it takes to
build up a telnet connection to a known host (ip/port). I tried to use
subprocess.Popen to build the telnet connection and then to catch the
"Trying to connect..." and "Connection established" output. But this
didn't work - both had always the same timestamp (time.time()) - i think
that's due to some buffers.

Has anyone an idea how to solve this?

Tanks in advance..
 
J

Jack diederich

I want to realize the following: I want to measure the time it takes to
build up a telnet connection to a known host (ip/port). I tried to use
subprocess.Popen to build the telnet connection and then to catch the
"Trying to connect..." and "Connection established" output. But this
didn't work - both had always the same timestamp (time.time()) - i think
that's due to some buffers.

Has anyone an idea how to solve this?

import time
import telnetlib

start = time.time()
conn = telnetlib.Telnet('localhost', 80)
print time.time() - start

-Jack
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,292
Messages
2,571,494
Members
48,183
Latest member
GarfieldBa

Latest Threads

Top