From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from tama50.ecl.ntt.co.jp (tama50.ecl.ntt.co.jp [129.60.39.147]) by dpdk.org (Postfix) with ESMTP id 6CCF8201 for ; Mon, 1 Oct 2018 05:14:27 +0200 (CEST) Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id w913EPq7024220; Mon, 1 Oct 2018 12:14:25 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id D1FF363889A; Mon, 1 Oct 2018 12:14:25 +0900 (JST) Received: from localhost.localdomain (unknown [129.60.13.51]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id C395B638705; Mon, 1 Oct 2018 12:14:25 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: spp@dpdk.org, ferruh.yigit@intel.com Cc: Yasufumi Ogawa Date: Mon, 1 Oct 2018 12:14:12 +0900 Message-Id: <20181001031413.75652-5-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20181001031413.75652-1-ogawa.yasufumi@lab.ntt.co.jp> References: <20181001031413.75652-1-ogawa.yasufumi@lab.ntt.co.jp> X-TM-AS-MML: disable Subject: [spp] [PATCH 4/5] controller: change msg format in ConnectionThread X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Oct 2018 03:14:28 -0000 From: Yasufumi Ogawa ConnectionThread is a message broker between primary and controller. To apply with the change of primary's message format, it is change to send JSON messages to controller. Signed-off-by: Yasufumi Ogawa --- src/controller/conn_thread.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controller/conn_thread.py b/src/controller/conn_thread.py index 8bddfc0..ff0697e 100644 --- a/src/controller/conn_thread.py +++ b/src/controller/conn_thread.py @@ -29,7 +29,7 @@ class ConnectionThread(threading.Thread): self.stop_event.set() def run(self): - cmd_str = 'hello' + cmd_str = '' # infinite loop so that function do not terminate and thread do not # end. @@ -238,9 +238,9 @@ class PrimaryThread(threading.Thread): data = conn.recv(spp_common.SOCK_BUF_SIZE) if data: spp_common.PRIMARY2MAIN.put( - "recv:%s:{%s}" % (str(addr), data.decode('utf-8'))) + data.decode('utf-8').strip('\0')) else: - spp_common.PRIMARY2MAIN.put("closing:" + str(addr)) + spp_common.PRIMARY2MAIN.put('{"status": "closed"}') conn.close() self.sock_opened = False break -- 2.7.4