You can probably optimize all this a lot (less copying, using the buffer interface, etc) but at least you can get the idea.Īfter months of searching the internet, this is what I came up with, I have neatly packaged it into classes, with unit tests and documentation as SmoothStream check it out, it was the only simple and working version of streaming I could find anywhere. Msg_size = struct.unpack("H", packed_msg_size)
#How to send lives & extra movies on candy crush code
Change "H" to "L" if you have a larger frame.Ĭndall(struct.pack("H", len(data))+data) # new code