diff options
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_async_client.py')
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_async_client.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_async_client.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_async_client.py index 0f73792a..2c95844b 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_async_client.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_async_client.py @@ -13,6 +13,7 @@ from .trex_stl_jsonrpc_client import JsonRpcClient, BatchMessage from .utils.text_opts import * from .trex_stl_stats import * from .trex_stl_types import * +from .utils.zipmsg import ZippedMsg # basic async stats class class CTRexAsyncStats(object): @@ -156,7 +157,9 @@ class CTRexAsyncClient(): self.monitor = AsyncUtil() self.connected = False - + + self.zipped = ZippedMsg() + # connects the async channel def connect (self): @@ -214,7 +217,7 @@ class CTRexAsyncClient(): # done self.connected = False - + # thread function def _run (self): @@ -232,10 +235,17 @@ class CTRexAsyncClient(): try: with self.monitor: - line = self.socket.recv_string() + line = self.socket.recv() self.monitor.on_recv_msg(line) + # try to decomrpess + unzipped = self.zipped.decompress(line) + if unzipped: + line = unzipped + + line = line.decode() + self.last_data_recv_ts = time.time() # signal once |