Skip to content
Snippets Groups Projects
Commit 28e9cc49 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Expose the ability to connect to a remote server

parent 6351688f
No related branches found
No related tags found
No related merge requests found
......@@ -51,13 +51,16 @@ class Client:
self.__dict__[serviceName [0]] = client
def __init__(self, clients = defaultClients):
def __init__(self, clients = defaultClients, url = "corbaloc:rir:/NameService"):
"""
Initialize CORBA and create default clients.
:param url: URL in the IOR, corbaloc, corbalocs, and corbanames formats.
For a remote corba server, use
url = "corbaloc:iiop:<host>:<port>/NameService"
"""
import sys
self.orb = CORBA.ORB_init (sys.argv, CORBA.ORB_ID)
obj = self.orb.resolve_initial_references("NameService")
obj = self.orb.string_to_object (url)
self.rootContext = obj._narrow(CosNaming.NamingContext)
if self.rootContext is None:
raise CorbaError ('failed to narrow the root context')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment