Server and Client classes taken from blackboard.