emit connect in nextTick so any exceptions are handled by app and not json socket