Singleton COM local/remote server?

John Lull lull at acm.org
Wed Jul 5 00:36:02 EDT 2000


I'm prototyping a DCOM server in Python.  The server coordinates
access from several clients scattered across a network to multiple
devices hung off each of several interface ports.  Some or all of it
will likely be ported to C once we're satisfied the API is right, and
as performance dictates. 

The server will have a single Coordinator object, a single Port object
with its own thread for each port, a single Device object with its own
thread for each device, multiple PortAccess objects to provide client
access to each port object, and multiple DeviceAccess objects to
provide client access to each device.  Client programs will get access
to the server via win32com.client.Dispatch('MyServer.Coordinator') (or
the equivalent in another language), then request PortAccess and
DeviceAccess objects from appropriate factory methods.

I've got most of the innards worked out, figured out how to register
it, wrap the access objects so I can hand out references to clients,
etc, but --

Since each port can belong to at most one server, I cannot have
multiple servers on the same machine.  I can't figure out how to
ensure there is only *one* copy of the server started, regardless of
how many clients want to use it.  

Any samples, pointers to documentation, key phrases to search MSDN
for, etc. would be *greatly* appreciated.

Thank you.

Regards,
John



More information about the Python-list mailing list