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 <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
FUJITA Tomonori 2012-02-25 11:47:14 +09:00
parent d0e3264a84
commit f6741e9c93

View File

@ -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