[Twisted-Python] Unpedictable behaviour of transport.write call: Problem with return the control to reactor

naman jain namanvit at gmail.com
Tue Nov 3 23:58:53 MST 2009


Hi,

I was trying this out:


Server code:

def dataReceived(self, data):
    if (args["cmd"] == "CHECK_IN"):
        foo = subprocess.Popen('python master.py',shell = True)
        *# this ACK notifies the client to close the connection*
        self.transport.write( self.create_message("CHECK_IN","ACK") )

I use the subprocess call , as I want to avoid threads here, and
independently launch my master.py without blocking this code.
I dont aim to have any interaction with the master.py once it is launched

Now, I see unpredictable behaviour here..
I have been trying many times, but the subprocess call does not happen
everytime !
The connection is closed by the client without the master getting launched
in some cases.

How does the transport.write behave in such cases.. Do you people see a
structural problem here.. Or adding some small delay of 2 sec before
transport.write might help?

Regards
Naman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20091104/004eab79/attachment-0001.html>


More information about the Twisted-Python mailing list