I want to open another socket to the player so that I can have that exclusively for unit data server to client.
I’ve tried creating a struct that then uses RPC to go from server to client, but that hit a limit and was not very good as it they would have to be reliable RPC, obviously that didn’t as I would hit a limit on the amount of data that could be sent in a single RPC and then it would also depend on the clients ability to processes each RPC, and if the client was not able to process it, any further RPCs that have unit data would be lost to the void.
So naturally I then tried a replicated array of structs that then had a list of updates, since not all updates would apply to each player as each player would processes them at different rates, I had all the updates routed through the player controller allowing me to target specific players such that when they join later in the game they would be able to receive all the updates needed and any further updates would be tacked onto the end of the unsent buffer, this also relied on the client sending a reliable RPC to the server that would then let the server know that it should send the next set of updates, then I also found that the array would not replicate all the time, so I would have to have the client test every 1.5 seconds to tell the server that it should send data as I found out that the issue was that the client RPC was not running server side so the server didn’t know that it needed to update the unit update buffer that would then be replicated. Again I found a limit to the amount of data that could be sent at any time, keep in mind that the size of the update was only 60 bytes, so really not that much and it turns out that replicated arrays can only replicate 32768 bytes at a time. So when the client would run the repnotify for the replicated update buffer, it would process the updates then run the RPC telling the server that it should send the next bunch of updates. I was again met with another bottle neck of networking.
So I again attempted having a replicated array that was again just the network update but instead of having the update buffer clear itself every time, it would change the values inside of the array such that they would replicate to the client, and since the arrays only replicate the changes between states when they change, it dramatically reduced network usage but it would reach a point where all the data would be garbage and not real unit information.
I have looked around for days trying to find something about opening a connection using in engine resources, I came across UNetDriver and UNetConnection, but I could not find anything on how to actually use them
tldr
How do I make a separate connection to the client so that I can send unit information using in engine resources, something like winsock2 but not horrible to work with
Thanks!