Skip to content

Commit

Permalink
[compat] List the protocols to convert
Browse files Browse the repository at this point in the history
  • Loading branch information
Nobu19800 committed Jan 24, 2022
1 parent 8ce2652 commit 2e30723
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 32 deletions.
48 changes: 30 additions & 18 deletions OpenRTM_aist/CORBA_RTCUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -1602,24 +1602,36 @@ class CorbaURI:
# @endif
def __init__(self, uri, objkey=""):
import urllib.parse
if uri.find("giop:tcp:") == 0:
uri = uri.replace("giop:tcp:", "corbaloc:iiop:")
elif uri.find("giop:ssl:") == 0:
uri = uri.replace("giop:ssl:", "corbaloc:ssliop:")
elif uri.find("giop:http:") == 0:
uri = uri.replace("giop:http:", "")
elif uri.find("giop::") == 0:
uri = uri.replace("giop::", "corbaloc:iiop:")
elif uri.find("iiop://") == 0:
uri = uri.replace("iiop://", "corbaloc:iiop:")
elif uri.find("diop://") == 0:
uri = uri.replace("diop://", "corbaloc:diop:")
elif uri.find("uiop://") == 0:
uri = uri.replace("uiop://", "corbaloc:uiop:")
elif uri.find("shmiop://") == 0:
uri = uri.replace("shmiop://", "corbaloc:shmiop:")
elif uri.find("inet:") == 0:
uri = uri.replace("inet:", "corbaloc:iiop:")
protocols_str = {"giop:tcp:": "corbaloc:iiop:",
"giop:ssl:": "corbaloc:ssliop:",
"giop:http:": "",
"giop::": "corbaloc:iiop:",
"iiop://": "corbaloc:iiop:",
"diop://": "corbaloc:diop:",
"uiop://": "corbaloc:uiop:",
"ssliop://": "corbaloc:ssliop:",
"shmiop://": "corbaloc:shmiop:",
"htiop://": "corbaloc:htiop:",
"inet:": "corbaloc:iiop:"}

converted = False
for k, v in protocols_str.items():
if uri.find(k) == 0:
uri = uri.replace(k, v)
converted = True
break

protocols_o_str = {"iiop:": "corbaloc:iiop:",
"ssliop:": "corbaloc:ssliop:",
"diop:": "corbaloc:diop:",
"shmiop:": "corbaloc:shmiop:",
"htiop:": "corbaloc:htiop:"}

if not converted:
for k, v in protocols_o_str.items():
if uri.find(k) == 0:
uri = uri.replace(k, v)
break

self._uri = ""
self._port = None
Expand Down
22 changes: 8 additions & 14 deletions OpenRTM_aist/Manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1799,22 +1799,16 @@ def createORBOptions(self):

@staticmethod
def isORBEndPoint(endpoint):
if "giop:" in endpoint:
return True
elif "iiop://" in endpoint:
return True
elif "diop://" in endpoint:
return True
elif "uiop://" in endpoint:
return True
elif "shmiop://" in endpoint:
return True
elif "inet:" in endpoint:
return True
return False

headers = ["giop:", "iiop://",
"diop://", "uiop://",
"ssliop://", "shmiop://",
"htiop://", "inet:"]

for header in headers:
if header in endpoint:
return True

return False

##
# @if jp
Expand Down

0 comments on commit 2e30723

Please sign in to comment.