checking an ip

Radovan Garabik garabik at center.fmph.uniba.sk.spam
Wed Sep 13 17:28:18 CEST 2000


Peter Schneider-Kamp <peter at schneider-kamp.de> wrote:
 : You could do this with the signal module (as proposed by someone),
 : but you really want to have timeoutsocket.py (look in the archives).

sigh...
and to be more precise, look at yesterday's post labelled
nntplib timeout bug?
interval between posts asking about timeout for sockets is already 
down to 2 days.. great :-)

 : Ian Weeks schrieb:
 :> 
 :> I would like to know how to see if a certain IP is active. I want to login
 :> using the ftplib module, but when the given IP number does not exist, it
 :> just hangs, or waits for a long time to timeout. Ping has the same problem.
 :> So what I need is a way to say:
 :> 
 :> # Some pseudo code
 :> ftp = FTP('xxx.xxx.xxx.xxx', timeout='3')
 :> 
 :> so, if the connection isn't established in 3 seconds, an exception is
 :> raised, or ftp gets value 0.
 :> 
 :> I guess there is a way to do this, but how? Can anyone help me out?
 :> 

-- 
 -----------------------------------------------------------
| Radovan Garabik  http://melkor.dnp.fmph.uniba.sk/~garabik |
| __..--^^^--..__         garabik @ fmph . uniba . sk       |
 -----------------------------------------------------------



More information about the Python-list mailing list