slow networking

hi,

of course I have read some threads about this “bleeding edge” for some people. So in my case I wanna set up networking eventually over “asyncio” but didn’t now who it is effectively usable in networking (sending, receiving or both?)

also to maximize speed for reading and sending of data I am glad to hear some tips.

and for those who wanna see my tests in multiplayer:

Server_scripts.zip (854 KB)

not finished

Main idea how I realized my network structure


Your received() method needs some work:

  1. Don’t use an error flag. Just us break if you want to exit the while loop.
  2. Don’t return inside the while loop. It means you don’t process more than one message per-function call, which probably means it seems like your game is lagging. You should try and handle all received data until the socket.error exception is raised, then return.

thanks for response, I wanna work it out and report later how I done

get it to work! thanks can you give me a hint for setting up for asyncio? (run_forever, run_until_complete) <- most suitable for this?
setting it up only for receiving or also for sending?

Asyncio is one option. I’ve not actually thought about whether it’s good enough for performant games. I suspect it’s probably ok for most users at this stage, but when you’re getting started, perhaps stick to using raw UDP sockets.

looks like I have to learn about raw UDP next time I will make some test about asyncio