DCOM
Distributed COM does it all for you. You don’t have to change a single line of your Python code. All you need is to enable a few settings on the server (which are not specific to this application, but to DCOM in general) and to change one line in the client code. Here are the steps:
DCOM needs to be enabled on the remote server. Choose Start → Run and type
dcomcnfg.exe. A configuration dialog starts up. Select the Default Properties tab and check the box for Enable Distributed COM on this computer.Python and PythonWin should be installed properly on the server, and the Doubletalk COM server should be registered.
In our Visual Basic program, go to the line of code where we create the
BookServer, and add a parameter for the remote machine name. We added an extra box in the Options dialog, the contents of which are stored in the variableRemoteMachine. Here’s the startup code:Set BookServer = CreateObject("Doubletalk.BookServer",RemoteMachine)If the string
RemoteMachineis empty, the local server starts up. Otherwise, DCOM talks to the remote machine, and theBookServerstarts up there. All calls to the COM object and any return values (including large arrays of data) are automatically packaged and transported across the network.
To demonstrate this, we created a data file called remotedata.dtj on a machine called yosemite and ran the client on a different machine. In the Options box input the name yosemite and hit the Reload button. At this point, the COM server starts on the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access