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

Method _receive

opcua/client/ua_client.py:111–123  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

109 self.logger.info("Thread ended")
110
111 def _receive(self):
112 msg = self._connection.receive_from_socket(self._socket)
113 if msg is None:
114 return
115 if isinstance(msg, ua.Message):
116 self._call_callback(msg.request_id(), msg.body())
117 elif isinstance(msg, ua.Acknowledge):
118 self._call_callback(0, msg)
119 elif isinstance(msg, ua.ErrorMessage):
120 self.logger.fatal("Received an error: %s", msg)
121 self._call_callback(0, ua.UaStatusCodeError(msg.Error.value))
122 else:
123 raise ua.UaError("Unsupported message type: {}".format(msg))
124
125 def _call_callback(self, request_id, body):
126 with self._lock:

Callers 1

_runMethod · 0.95

Calls 4

_call_callbackMethod · 0.95
receive_from_socketMethod · 0.80
request_idMethod · 0.80
bodyMethod · 0.80

Tested by

no test coverage detected