The order of connection.Pump() and self.Pump()

47 views
Skip to first unread message

Peter

unread,
Aug 14, 2009, 5:38:11 PM8/14/09
to PodSixNet
Hi!


I'm writing a game using your PodSixNet library. I'm quite glad for
it, it is easy to use.

I started to understand the usage of the library by reading the
example files. I found a little mistake. In fact it is not a mistake,
but it lead me to a bug.

First of all, I'm lazy (like everbody else). In my game the menu HOST
GAME starts a server and a client (in the same thread), and the client
connects to the server. It's localhost, and they are even inside the
same program (I know I could solve this problem inside the program by
passing variables, but I'm lazy). My server works almost fine, it can
communicate to the other clients, but it can't send messages to the
client which is inside the same program.

I suggest the following modification in the file WhiteboadClient.py.
The lines are:

def Loop(self):
connection.Pump()
self.Pump()
....


I think the two lines with the call Pump() should be switched as:

def Loop(self):
self.Pump()
connection.Pump()
....


If the client and the server are in separate programs, then it
doesn't matter, otherwise the order of the two Pump() calls are
important.


Best wishes,
Peter

Chris McCormick

unread,
Aug 15, 2009, 5:14:40 AM8/15/09
to pods...@googlegroups.com
Hi Peter!

On Fri, Aug 14, 2009 at 02:38:11PM -0700, Peter wrote:
> I suggest the following modification in the file WhiteboadClient.py.
> The lines are:
>

> I think the two lines with the call Pump() should be switched as:
>

> If the client and the server are in separate programs, then it
> doesn't matter, otherwise the order of the two Pump() calls are
> important.

Great stuff, thanks very much for the bug report. I will make this modification
and commit.

Best,

Chris.

-------------------
http://mccormick.cx

Reply all
Reply to author
Forward
0 new messages