On 5/05/2011 5:49 PM, Michael Illgner wrote:
I just took a look at the registry, the InprocServer32 key of my COM
component has an entry ThreadingModel with value "both".
So I if create the COM objects in the main thread and the socket
server starts a new thread for every incoming request
(socketserver.ThreadingMixIn) and the request handler uses
pythoncom.CoInitialize/CoUninitialize for every request I should be on
the right side ? This seems to work, but should I expect memory leaks,
dangling handles etc. ?

Should be fine.

So in effect you are just "broadcasting" on the tcp-server in response to
the COM events?  I expect you will wind up needing a queue per connection,
with each COM event sticking stuff in the queue and the tcp handlers reading
from one.
yes, the COM object send some status events during their lifetime, not
directly related to other COM calls. The python event handler just
collects the data for an event and sends them to another server using
a socket.

Sounds good too - so long as you have a handle on the fact the events may be delivered on a different thread than the server response thread, you should be in good shape :)

Cheers,

Mark
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to