1
General discussions / Why isn't there a networking event?
« on: May 04, 2020, 12:36:58 pm »
Game Maker has it, and it makes sense to me honestly. Not as default, but as a feature the programmer can either enable or disable.
The idea is being able to receive and elaborate networking messages through the events system, without requiring the user to deal with async stuff.
Right now for what i'm working on i'll make a class that does exactly that, in a second thread it takes data from the network and fills a queue; the main cycle after handling events handles that queue's content as if it was another event. (well it's more complex than that for thread safety and actually uses two queues so you don't lock the main thread, but that's the idea.)
The idea is being able to receive and elaborate networking messages through the events system, without requiring the user to deal with async stuff.
Right now for what i'm working on i'll make a class that does exactly that, in a second thread it takes data from the network and fills a queue; the main cycle after handling events handles that queue's content as if it was another event. (well it's more complex than that for thread safety and actually uses two queues so you don't lock the main thread, but that's the idea.)