Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
opcua.client.ua_client.UASocketClient Class Reference
Inheritance diagram for opcua.client.ua_client.UASocketClient:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, timeout=1, security_policy=ua.SecurityPolicy())
 
def check_answer (self, data, context)
 
def close_secure_channel (self)
 
def connect_socket (self, host, port)
 
def disconnect_socket (self)
 
def open_secure_channel (self, params)
 
def send_hello (self, url)
 
def send_request (self, request, callback=None, timeout=1000, message_type=ua.MessageType.SecureMessage)
 
def start (self)
 

Public Attributes

 authentication_token
 
 logger
 
 timeout
 

Private Member Functions

def _call_callback (self, request_id, body)
 
def _create_request_header (self, timeout=1000)
 
def _receive (self)
 
def _run (self)
 
def _send_request (self, request, callback=None, timeout=1000, message_type=ua.MessageType.SecureMessage)
 

Private Attributes

 _callbackmap
 
 _connection
 
 _do_stop
 
 _lock
 
 _request_handle
 
 _request_id
 
 _socket
 
 _thread
 

Detailed Description

handle socket connection and send ua messages
timeout is the timeout used while waiting for an ua answer from server

Definition at line 16 of file ua_client.py.

Constructor & Destructor Documentation

def opcua.client.ua_client.UASocketClient.__init__ (   self,
  timeout = 1,
  security_policy = ua.SecurityPolicy() 
)

Definition at line 21 of file ua_client.py.

Member Function Documentation

def opcua.client.ua_client.UASocketClient._call_callback (   self,
  request_id,
  body 
)
private

Definition at line 115 of file ua_client.py.

def opcua.client.ua_client.UASocketClient._create_request_header (   self,
  timeout = 1000 
)
private

Definition at line 122 of file ua_client.py.

def opcua.client.ua_client.UASocketClient._receive (   self)
private

Definition at line 102 of file ua_client.py.

def opcua.client.ua_client.UASocketClient._run (   self)
private

Definition at line 90 of file ua_client.py.

def opcua.client.ua_client.UASocketClient._send_request (   self,
  request,
  callback = None,
  timeout = 1000,
  message_type = ua.MessageType.SecureMessage 
)
private
send request to server, lower-level method
timeout is the timeout written in ua header
returns future

Definition at line 43 of file ua_client.py.

def opcua.client.ua_client.UASocketClient.check_answer (   self,
  data,
  context 
)

Definition at line 80 of file ua_client.py.

def opcua.client.ua_client.UASocketClient.close_secure_channel (   self)
close secure channel. It seems to trigger a shutdown of socket
in most servers, so be prepare to reconnect.
OPC UA specs Part 6, 7.1.4 say that Server does not send a CloseSecureChannel response and should just close socket

Definition at line 170 of file ua_client.py.

def opcua.client.ua_client.UASocketClient.connect_socket (   self,
  host,
  port 
)
connect to server socket and start receiving thread

Definition at line 130 of file ua_client.py.

def opcua.client.ua_client.UASocketClient.disconnect_socket (   self)

Definition at line 140 of file ua_client.py.

def opcua.client.ua_client.UASocketClient.open_secure_channel (   self,
  params 
)

Definition at line 157 of file ua_client.py.

def opcua.client.ua_client.UASocketClient.send_hello (   self,
  url 
)

Definition at line 146 of file ua_client.py.

def opcua.client.ua_client.UASocketClient.send_request (   self,
  request,
  callback = None,
  timeout = 1000,
  message_type = ua.MessageType.SecureMessage 
)
send request to server.
timeout is the timeout written in ua header
returns response object if no callback is provided

Definition at line 68 of file ua_client.py.

def opcua.client.ua_client.UASocketClient.start (   self)
Start receiving thread.
this is called automatically in connect and
should not be necessary to call directly

Definition at line 34 of file ua_client.py.

Member Data Documentation

opcua.client.ua_client.UASocketClient._callbackmap
private

Definition at line 31 of file ua_client.py.

opcua.client.ua_client.UASocketClient._connection
private

Definition at line 32 of file ua_client.py.

opcua.client.ua_client.UASocketClient._do_stop
private

Definition at line 27 of file ua_client.py.

opcua.client.ua_client.UASocketClient._lock
private

Definition at line 24 of file ua_client.py.

opcua.client.ua_client.UASocketClient._request_handle
private

Definition at line 30 of file ua_client.py.

opcua.client.ua_client.UASocketClient._request_id
private

Definition at line 29 of file ua_client.py.

opcua.client.ua_client.UASocketClient._socket
private

Definition at line 26 of file ua_client.py.

opcua.client.ua_client.UASocketClient._thread
private

Definition at line 23 of file ua_client.py.

opcua.client.ua_client.UASocketClient.authentication_token

Definition at line 28 of file ua_client.py.

opcua.client.ua_client.UASocketClient.logger

Definition at line 22 of file ua_client.py.

opcua.client.ua_client.UASocketClient.timeout

Definition at line 25 of file ua_client.py.


The documentation for this class was generated from the following file:


ros_opcua_impl_python_opcua
Author(s): Denis Štogl , Daniel Draper
autogenerated on Tue Jan 19 2021 03:12:44