[Tutor] opening multiple connections to a port

Kent Johnson kent37 at tds.net
Tue May 9 14:09:59 CEST 2006


Payal Rathod wrote:
> Hi,
> I have to see how many open connection can a particular service handle.
> So, I want to similuate something like this but using Python.
> telnet <host> <port>
> 
> I will be keeping these connections open for around 60 seconds. Can 
> anyone tell me how do I start with this in Python? I read a bit about 
> telnetlib, but unable to figure how to open multiple simeltaneous 
> connections.

If you create and open multiple instances of telnetlib.Telnet you should 
have multiple connections to the host.

Of course for this test to give meaningful results the machine running 
the test must be able to open more outgoing ports than the number of 
connections supported by the host, or you will have to use multiple 
client machines.

Kent



More information about the Tutor mailing list