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

Method _process_data

opcua/server/binary_server_asyncio.py:60–84  ·  view source on GitHub ↗
(self, data)

Source from the content-addressed store, hash-verified

58 self._process_data(data)
59
60 def _process_data(self, data):
61 buf = ua.utils.Buffer(data)
62 while True:
63 try:
64 backup_buf = buf.copy()
65 try:
66 hdr = uabin.header_from_binary(buf)
67 except ua.utils.NotEnoughData:
68 logger.info("We did not receive enough data from client, waiting for more")
69 self.data = backup_buf.read(len(backup_buf))
70 return
71 if len(buf) < hdr.body_size:
72 logger.info("We did not receive enough data from client, waiting for more")
73 self.data = backup_buf.read(len(backup_buf))
74 return
75 ret = self.processor.process(hdr, buf)
76 if not ret:
77 logger.info("processor returned False, we close connection from %s", self.peername)
78 self.transport.close()
79 return
80 if len(buf) == 0:
81 return
82 except Exception:
83 logger.exception("Exception raised while parsing message from client, closing")
84 return
85
86
87class BinaryServer(object):

Callers 1

data_receivedMethod · 0.95

Calls 4

copyMethod · 0.95
processMethod · 0.80
readMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected