<HTML><HEAD>
<STYLE id=eMClientCss>
blockquote.cite { margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right:0px; border-left: 1px solid #cccccc }
blockquote.cite2 {margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right:0px; border-left: 1px solid #cccccc; margin-top: 3px; padding-top: 0px; }
.plain pre, .plain tt { font-family: monospace; font-size: 100%; font-weight: normal; font-style: normal; white-space: pre-wrap; }
a img { border: 0px; }body {font-family: Tahoma;font-size: 12pt;}
.plain pre, .plain tt {font-family: Tahoma;font-size: 12pt;}</STYLE>
</HEAD>
<BODY>
<DIV>I'm trying to pass a TCP connection to a Twisted subprocess with adoptStreamConnection, but I can't figure out how to get the Process disposed in the main process after doing that.</DIV>
<DIV> </DIV>
<DIV>My desired flow looks like this:</DIV>
<DIV> </DIV>
<DIV>- Finish writing any data the Protocol transport has waiting<BR>- When we know the write buffer is empty send the AMP message to transfer the socket to the subprocess<BR>- Dispose the Protocol instance in the main process<BR>- I tried doing nothing, loseConnection, abortConnection, and monkey patching _socketClose out and using loseConnection. See code here: <A href="http://pastebin.com/nK0Huxuj">http://pastebin.com/nK0Huxuj</A></DIV>
<DIV> </DIV>
<DIV>In all cases the Protocol object still exists in the main process after the socket has been transferred, even if the main process isn't listening to that socket anymore. How can I clean this up?</DIV>
<DIV> </DIV>
<DIV>Thanks in advance.</DIV></BODY></HTML>