From: Eric C. N. <eri...@us...> - 2002-04-30 11:37:31
|
Update of /cvsroot/recall/corba/src/Recall In directory usw-pr-cvs1:/tmp/cvs-serv18708/Recall Modified Files: CorbaUtil.py Log Message: add wait for designated port Index: CorbaUtil.py =================================================================== RCS file: /cvsroot/recall/corba/src/Recall/CorbaUtil.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CorbaUtil.py 21 Feb 2002 13:11:12 -0000 1.7 --- CorbaUtil.py 30 Apr 2002 11:37:28 -0000 1.8 *************** *** 3,16 **** import CORBA CosNaming = CORBA.CosNaming NoNamingContext = "no naming context" class Contexts: "A class to simplify access to CORBA and contexts" def __init__(self, argv): "Initialize the orb, and establish a root and naming context" self.__orb = CORBA.ORB_init(argv, CORBA.ORB_ID) ! self.__poa = self.__orb.resolve_initial_references("RootPOA") self.__poa2 = self.__orb.resolve_initial_references("omniINSPOA") --- 3,31 ---- import CORBA CosNaming = CORBA.CosNaming + import Log NoNamingContext = "no naming context" + LISTEN_TIMEOUT = 5.0 + LISTEN_PAUSE = 1.0 + class Contexts: "A class to simplify access to CORBA and contexts" def __init__(self, argv): + import time "Initialize the orb, and establish a root and naming context" self.__orb = CORBA.ORB_init(argv, CORBA.ORB_ID) ! ! start = time.time() ! while 1: ! try: ! self.__poa = self.__orb.resolve_initial_references("RootPOA") ! break ! except Exception, exc: ! if time.time() - start > LISTEN_TIMEOUT: ! raise ! Log.error('Waiting for free port') ! time.sleep(LISTEN_PAUSE) self.__poa2 = self.__orb.resolve_initial_references("omniINSPOA") |