raiseConnectionError("Connection is closed")fromNone
...
...
@@ -173,9 +168,7 @@ class UASocketProtocol(asyncio.Protocol):
try:
self._callbackmap[request_id].set_result(body)
exceptKeyError:
raiseua.UaError(
f"No request found for request id: {request_id}, pending are {self._callbackmap.keys()}"
)
raiseua.UaError(f"No request found for request id: {request_id}, pending are {self._callbackmap.keys()}")
exceptasyncio.InvalidStateError:
ifnotself.closed:
raiseua.UaError(f"Future for request id {request_id} is already done")
...
...
@@ -216,13 +209,9 @@ class UASocketProtocol(asyncio.Protocol):
request=ua.OpenSecureChannelRequest()
request.Parameters=params
ifself._open_secure_channel_exchangeisnotNone:
raiseRuntimeError('Two Open Secure Channel requests can not happen too close to each other. '
'The response must be processed and returned before the next request can be sent.')
raiseRuntimeError('Two Open Secure Channel requests can not happen too close to each other. ''The response must be processed and returned before the next request can be sent.')
raiseua.UaError(f"Received chunk: {chunk} with wrong sequence expecting:"f" {self._peer_sequence_number}, received: {seq_num},"f" spec says to close connection")
raise NotImplementedError(f"Only StructureType implemented, not {ua.StructureType(sdef.StructureType).name} for node {name} with DataTypdeDefinition {sdef}")
code = f"""
...
...
@@ -81,7 +81,7 @@ class {name}:
code += 'ua_types=[\n'
if sdef.StructureType == ua.StructureType.StructureWithOptionalFields: