简体   繁体   中英

Pygame Event Queue Max

I'm taking some data over the network and inputing it into Pygame as Events.

If the network is congested or the connection drops briefly, a lot of data comes at once when it becomes decongested. When that happens, the event queue fills up fast to the point it gives me this error:

error: Event queue full

Searching different sites has not yielded me any answers. What is the maximum number of events in queue in Pygame?

Pygame is built upon SDL, and everything I've been able to find says the SDL event queue has a 127 element limit. What library are you using to push networking on to the queue? It seems like it would take an awful lot of network traffic to flood the event queue if you are flushing it every game loop, even if it gets backed up. Also, what events specifically are you queuing here? Maybe you should be buffering your network traffic each game loop and throwing out irrelevant information so you don't generate as many events.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM