Server implemented in CPP style.