Placing them in a namespace is an option. I do not see the need for a class. The class instance is average for representing the state, but you are describing many free functions, therefore the system is stateless.
"Do not undermine every function in one class." - This is not a valid argument for deciding not to write a class. A class can have one element and one method, but if there is logic, you should write it.
If your functions and your logic require the use of a class, where your functions have the same logic, but work differently depending on the object, by all means, write a class. If your only goal is to combine functions together when their logic does not rely on the same instance of the class, group them in a namespace.
An example based on your question:
namespace NetworkHelpers {
As you can see, inside the namespace, a function does not depend on anything but a parameter.
Inside the class, since it has a state, and you create an object for each server (so similar behavior, but different depending on the object), you call the function without parameters, because the object has a state.
Hope this is clear.
source share