Re: Thread Question



On 2006-02-28, D <duncanm255@xxxxxxxxxxx> wrote:

I have a client application that I want (behind the scenes) to check
and make sure a remote host is up (i.e. by ping or TCP connect). I'm
assuming that, since I want this to go on "unknowingly" to the user,
that I would put this in a thread.

Probably.

My question is, how would I go about creating the thread?

Assuming foo is the function you want to start in a thread:

threading.Thread(target=foo).start()

I have seen examples that used classes, and other examples
that just called one thread start command - when should you
use one over another?

I'm not sure what you mean by "use classes" vs. "calling a
thread start command". My example above uses a class
(threading.Thread) to create a thread object, and then calls
its start method.

--
Grant Edwards grante Yow! HELLO, little boys!
at Gimme a MINT TULIP!! Let's
visi.com do the BOSSA NOVA!!
.



Relevant Pages

  • Thread Question
    ... I have a client application that I want (behind the scenes) to check ... and make sure a remote host is up (i.e. by ping or TCP connect). ...
    (comp.lang.python)
  • Re: Good wireless signal - but browser cannot find it?
    ... But when I gave the command to see the route table, ... But his browser cannot find any connection and displays the error page ... The firewall is Norton - but disabling it temporarily made no difference. ... ping resolver1.opendns.com ...
    (microsoft.public.windowsxp.network_web)
  • Re: ipcBeginProcess Error Please help. thanks!
    ... the command that I am executing is a batch file. ... And the "cdsServIpc: Command not found." ... the exact file system path on the remote host also. ...
    (comp.cad.cadence)
  • Re: Missing items in XP
    ... ISP asked me to ping a site and ping was not recognized as a command. ... Isp man told me I had lost essential tools in XP. ... You can confirm this by opening a command prompt, changing to the windows\system32 directory, and running commands such as ping. ... Do I need those user variables? ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: .bat file for "keep open ping" not working after WinXPsp2 clea
    ... with simply pasting your suggested ping to google in the command line again ... I don't know why it changed my ping from www.google.com to www.1.google.com ... If you do not get a response then there is something wrong ... This has nothing at all to do with the batch file. ...
    (microsoft.public.windowsxp.general)