Optimizing data sent

25 views
Skip to first unread message

Winston

unread,
Jan 29, 2010, 7:09:08 PM1/29/10
to PodSixNet
Dear Chris and PodSixNet developers-

First of all, congratulations on this very nice little graphics
library. We are using for a multiplayer educational game
(stratolab.com).

I want to start gathering data on how much data is sent over the
network in order to optimize my network synchronization code. I've
made this slight change locally, but I thought it would be nice to
include in the distribution. It simply returns the number of bytes
sent by Channel.Send() so I can track it.

Channel.py
-----------------
def Send(self, data):
self.sendqueue.append(dumps(data) + self.endchars)

return how much data is being sent:

def Send(self, data):
'Returns the number of bytes sent after encoding.'
encoded_data = dumps(data)
self.sendqueue.append(encoded_data + self.endchars)
return len(encoded_data) + len(self.endchars) # num bytes sent


Chris McCormick

unread,
Feb 4, 2010, 6:50:17 AM2/4/10
to pods...@googlegroups.com
Hi Winston,

Great, thanks for the patch. I will incorporate your change and update the
repository as soon as possible.

Cheers!

Chris.

> --
> You received this message because you are subscribed to the Google Groups "PodSixNet" group.
> To post to this group, send email to pods...@googlegroups.com.
> To unsubscribe from this group, send email to podsixnet+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/podsixnet?hl=en.
>
-------------------
http://mccormick.cx

Reply all
Reply to author
Forward
0 new messages