Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite loop of retries when connection fails #6

Open
qboot opened this issue Aug 14, 2018 · 0 comments
Open

Infinite loop of retries when connection fails #6

qboot opened this issue Aug 14, 2018 · 0 comments

Comments

@qboot
Copy link

qboot commented Aug 14, 2018

Hello!
First, thanks for your work with Thruway. 🙏

I'm trying to use a Thruway\Connection which uses internally Thruway\Transport\PawlTransportProvider and Thruway\Peer\Client.

Everything works as expected when I pass a "valid" $options array :

$connection = new Connection([
    'realm' => $realm,
    'authid' => $token,
    'url' => $url,
    'authmethods' => ['jwt'],
    'onChallenge' => function () {
        return 'challenge-message';
    },
]);

But what if for example $token contains an invalid token?

The Client onOpen() function looks like:

public function onOpen(TransportInterface $transport) {
    $this->retryTimer    = 0; // ?
    $this->retryAttempts = 0; // ?
    $this->transport     = $transport;
    $session             = new ClientSession($transport, $this);
    $this->session       = $session;
    $session->setLoop($this->getLoop());
    $session->setState(ClientSession::STATE_DOWN);
    $this->startSession($session);
}

My question is: Why re-set retryTimer and retryAttempts here?
In my case it causes an infinite loop of retries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant