[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] SOC Proposal: Networking for Pygame



If the networking is threaded or async, then using the pygame event
queue is quite possible.  A blocking api is not useful for games.

The reason for using the SDL event queue is to keep event management
in one place.  If people already understand the pygame event model,
then they should be able to reuse that knowledge for the network
events.


On 5/8/06, Peter Shinners <pete@xxxxxxxxxxxx> wrote:
On Sun, 2006-05-07 at 20:27 -0700, Brian Fisher wrote:
> Also, having to integrate the packet handling into your main loop
> wouldn't necessarily help you have good design - for some network
> models, it makes a lot more sense to encapsulate the communication

I'd lean towards this design as well. Just make the "pump" style
function also return all the updates since the previous call.

If the API is going to be threaded then using the Pygame/SDL event queue
makes a bit more sense. Make each connection take an event id number to
use. This is still easy enough to use, but avoids id collisions.