MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / connect

Method connect

opcua/client/client.py:267–290  ·  view source on GitHub ↗

High level method Connect, create and activate session

(self)

Source from the content-addressed store, hash-verified

265 return servers
266
267 def connect(self):
268 """
269 High level method
270 Connect, create and activate session
271 """
272 self.connect_socket()
273 try:
274 self.send_hello()
275 self.open_secure_channel()
276 try:
277 self.create_session()
278 try:
279 self.activate_session(username=self._username, password=self._password, certificate=self.user_certificate)
280 except Exception:
281 # clean up the session
282 self.close_session()
283 raise
284 except Exception:
285 # clean up the secure channel
286 self.close_secure_channel()
287 raise
288 except Exception:
289 self.disconnect_socket() # clean up open socket
290 raise
291
292 def disconnect(self):
293 """

Callers 15

wrapperFunction · 0.95
uareadFunction · 0.95
uawriteFunction · 0.95
ualsFunction · 0.95
uasubscribeFunction · 0.95
uaclientFunction · 0.95
uahistoryreadFunction · 0.95
uacallFunction · 0.95
uageneratestructsFunction · 0.95
__enter__Method · 0.95

Calls 8

connect_socketMethod · 0.95
send_helloMethod · 0.95
open_secure_channelMethod · 0.95
create_sessionMethod · 0.95
activate_sessionMethod · 0.95
close_sessionMethod · 0.95
close_secure_channelMethod · 0.95
disconnect_socketMethod · 0.95

Tested by 14

wrapperFunction · 0.76
test_nocryptoMethod · 0.76
test_basic256sha256Method · 0.76
test_discoveryMethod · 0.76
test_find_servers2Method · 0.76
setUpClassMethod · 0.64