Re: UDP socket server issues Python

Erg. Ctrl+enter apparently sends, unlike all the other apps where enter sends, so will have to continue this across a separate post.  Anyway, the body of your your main loop becomes:

while True:
    try:
        msg = read_queue.get(False)
    except queue.Empty:
        break
    handle_message(msg)
    do_whatever()

But overall even this is kind of meh because when using UDP you're also going to need to get state machines and stream handling going to readd all the things TCP doesn't offer, and then you're going to want to use TCp and UDP together because TCP works really well for chat channels and anything that needs to be sent reliably and in order, and then you're going to need to start reinventing asyncio or any number of other things that are already in libraries, and then you're going to have bugs in your reimplementations until the end of time because this stuff is actually really hard to do.  I would suggest finding a Python game networking library and using that instead.

BGT-style networking isn't UDP, it's a library called enet.  If you're looking for exactly what BGT does, there are various Python bindings to enet that you can use.  I don't know how good quality any of them are.



-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : visualstudio via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : visualstudio via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector

Reply via email to