Re: socket and subprocess problem

2008-12-18 Thread James Mills
On Thu, Dec 18, 2008 at 8:00 PM, Bryan Olson wrote: > I'd swear James copied my response, except his came first. Even the > formatting came out similar. I hadn't seen his response when I wrote mine, > and wouldn't have bothered posing the same thing again. Great minds think alike huh :) You shoul

Re: socket and subprocess problem

2008-12-18 Thread Bryan Olson
James Mills wrote: 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

Re: socket and subprocess problem

2008-12-15 Thread Bryan Olson
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. As Roy noted, that's "the cheesy way". Are the kind of programmers who accept che

Re: socket and subprocess problem

2008-12-15 Thread James Mills
On Tue, Dec 16, 2008 at 3:30 PM, 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 :

Re: socket and subprocess problem

2008-12-15 Thread goatold
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. Roy Smith wrote: > In article > <6d3291c3-4e12-4bdd-884a-21f15f38d...@a12g2000pro.googlegroups.com>, > goat..

Re: socket and subprocess problem

2008-12-15 Thread Roy Smith
In article <6d3291c3-4e12-4bdd-884a-21f15f38d...@a12g2000pro.googlegroups.com>, goat...@gmail.com wrote: > In my python code I use subprocess.Popen to run and external program > who will listen to a TCP port. And I also create a socket to connect > to the TCP port that the external program is li

Re: socket and subprocess problem

2008-12-15 Thread Bryan Olson
goat...@gmail.com wrote: In my python code I use subprocess.Popen to run and external program who will listen to a TCP port. And I also create a socket to connect to the TCP port that the external program is listening. I will get 'Connection refused, errno=111' when I try to socket.connect ().

socket and subprocess problem

2008-12-15 Thread goatold
Hi all, Here is my problem, see if any one else met this before In my python code I use subprocess.Popen to run and external program who will listen to a TCP port. And I also create a socket to connect to the TCP port that the external program is listening. I will get 'Connection refused, errno=11