[IMP] rpc send, reduce the number of write (reducing the number of packets)

bzr revid: al@openerp.com-20110118235238-qwpur4srw9d75nx5
This commit is contained in:
Antony Lesuisse 2011-01-19 00:52:38 +01:00
parent 62e28bf1af
commit 12e4cdf71b
1 changed files with 1 additions and 9 deletions

View File

@ -61,15 +61,7 @@ class mysocket:
def mysend(self, msg, exception=False, traceback=None):
msg = cPickle.dumps([msg,traceback])
size = len(msg)
self.sock.send('%8d' % size)
self.sock.send(exception and "1" or "0")
totalsent = 0
while totalsent < size:
sent = self.sock.send(msg[totalsent:])
if sent == 0:
raise RuntimeError, "socket connection broken"
totalsent = totalsent + sent
self.sock.sendall('%8d%s%s' % (len(msg), exception and "1" or "0", msg))
def myreceive(self):
buf=''