Create a new connection structure and pass this around to various event callbacks.