This looks hacky as hell. Can't you hook the reconnecting event and wait on a reset event instead?