diff options
| author | Antony Lesuisse <al@openerp.com> | 2011-01-19 00:52:38 +0100 |
|---|---|---|
| committer | Antony Lesuisse <al@openerp.com> | 2011-01-19 00:52:38 +0100 |
| commit | 12e4cdf71bbd7f6c328597720bb754064469d169 (patch) | |
| tree | 1861be59dd622fdf460a21d929542bf0c5d727d7 /bin/tiny_socket.py | |
| parent | 62e28bf1afc9b72a27bde19190df56b4dbf44fe9 (diff) | |
[IMP] rpc send, reduce the number of write (reducing the number of packets)
bzr revid: al@openerp.com-20110118235238-qwpur4srw9d75nx5
Diffstat (limited to 'bin/tiny_socket.py')
| -rw-r--r-- | bin/tiny_socket.py | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/bin/tiny_socket.py b/bin/tiny_socket.py index 6a0d9371ef5..44f7db04f01 100644 --- a/bin/tiny_socket.py +++ b/bin/tiny_socket.py @@ -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='' |
