From a62f2ccff0c43e004a80b540d992a9efbd754b9b Mon Sep 17 00:00:00 2001 From: nashim Date: Sun, 3 Mar 2013 01:01:56 +0100 Subject: [PATCH] WebSocket.send fix for big data on slow internet connections the send command fails sometimes to send all the data in one packet. then the websocket connection is out of sync and get's interrupted. --- websocket.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/websocket.py b/websocket.py index c00fad9..ad733a1 100644 --- a/websocket.py +++ b/websocket.py @@ -518,7 +518,9 @@ class WebSocket(object): if self.get_mask_key: frame.get_mask_key = self.get_mask_key data = frame.format() - self.io_sock.send(data) + while data: + l = self.io_sock.send(data) + data = data[l:] if traceEnabled: logger.debug("send: " + repr(data))