On Tue, Dec 16, 2008 at 3:30 PM, <goat...@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 -- http://mail.python.org/mailman/listinfo/python-list