socket and subprocess problem

James Mills prologic at shortcircuit.net.au
Tue Dec 16 01:03:55 EST 2008


On Tue, Dec 16, 2008 at 3:30 PM,  <goatold at gmail.com> wrote:
> Guys thanks to point it out.
> Yes, it's a race problem. I tried sleep long enough, then I can
> connect to the socket. I should add code to try to connect to the
> socket for a given time out.

This is where event-driven approaches
become really useful :)

subprocess process:

#1. When my subprocess process has successfully
       started notify the parent.
#2. When my subprocess process has successfully
       created a listening socket, notify the parent.

parent process:

#1. When our subprocess process has
       successfully started a listening socket
       initiate a connection.

I could implement a prototype of this
if the OP is interested.

--JamesMills



More information about the Python-list mailing list