From f6741e9c9345ae282679b40fc11da5188c028eee Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Sat, 25 Feb 2012 11:47:14 +0900 Subject: [PATCH] avoid reading too much data from socket Currently, we try to read OFP_MSG_SIZE_MAX (65535) from sockets. This hurts the performance badly. This patch changes ryu to read a single request from socket. Signed-off-by: FUJITA Tomonori --- ryu/controller/controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ryu/controller/controller.py b/ryu/controller/controller.py index cb854509..3c6c6dea 100644 --- a/ryu/controller/controller.py +++ b/ryu/controller/controller.py @@ -115,7 +115,7 @@ class Datapath(object): required_len = ofproto.OFP_HEADER_SIZE while self.is_active: - ret = self.socket.recv(ofproto.OFP_MSG_SIZE_MAX) + ret = self.socket.recv(required_len) if len(ret) == 0: self.is_active = False break