Client and Server implemented in C style.
Client re-implemented in CPP style.