C++ server code

Latest master merged in. We should discuss the layout of the code.
Probably a result of copy and pasting code. You're correct, result isn't needed in this scenario.