educational code of a connection handler - don't use this in your code