Open theaddonn opened 5 months ago
This is technically already supported internally, however this does add some refactoring and would require an API minor bump since this change would break the current API. I will look into this, but this change will target 0.4.0
rather than 0.3.0
how is this looking?
I will work on this sometime in July, I'm currently way to busy figuring out IRL stuff, I apologize.
After careful consideration, this change may not be needed. I looked into this further and one simple solution stuck out to me. One can simply create a new tokio task and return a clonable object full with channels to communicate with that task, to for example send packets, recieve packets or close the connection. This type of impl would not need any split cabability. I used this solution a lot and it works great.
It might be useful creating an example for that. I hope I can look into it, once I got the time.
In an async server software you often have a loop which recv packets and some sort of client struct that contains a way to send packets. This would mean we would either need to copy/clone the connection or split it.
Tokio's tcp stream has a nice way to split it into a recv half and write half.
this code is from stack overflow
Even though Raknet uses udp it would still be nice if an api for splitting the connection or copying/cloning it would be added. This is very important for writing effiecient server software that utilise multi threading.