I'm wondering how common it is for an application using a socket server to continuously send bytes, regardless there is actually any data to send.
For example, I have a socket server which sends a char array to all connected clients, even if the char array has no significant usage for the client.
Reason being, I need the server to send data to the client at the same speed the client sends data to the server. If I check for the buffer to have information before sending through this algorithm, it could cause data to not be sent to a client from another client until the client who needs the data firstly sends data (I.E a player must move in order to see another player move).
In order to prevent the above example, I stream all data, even an empty buffer, to all clients.
Is this normal, or should I worry about spending time on a new algorithm that only sends data when necessary?
Obviously it would be more beneficial to spend the time, but with deadlines I must prioritize.
How common is it for games to continuously send data, including empty data, instead of sending only data with a message?
↧