Revision 3 as of 2006-04-24 06:42:35

Clear message

Simple Networking For Pygame

Write a simple network library which integrates with the pygame event queue.

Basic requirements:

Potential API:

Things not to worry about:

NOTES, api part 2?

I think I like the url idea. We could not worry about connections at all by using urls. Optional carring about connections could be implmented.

UDP and ENet are interesting things to consider for the api. UDP is connectionless.

All bits of data could be strings.

The event queue api could event be used for some of it.

pygame.events.post(e)
events = pygame.events.get()

for e in events:
    if e.type == NET:
        if e.what == NET_DATA_IN:
            print e.channel
            print e.data
        if e.what == NET_CONNECT:
            print e.ip
            print e.port
            print e.sequence_id
            print e.channel
            pass

Unable to edit the page? See the FrontPage for instructions.