voryx / Thruway

PHP Client and Router Library for Autobahn and WAMP (Web Application Messaging Protocol) for Real-Time Application Messaging
MIT License
676 stars 117 forks source link

Client library behaviour when non-existent realm is used #325

Open BertHooyman opened 5 years ago

BertHooyman commented 5 years ago

When I attempt to connect to a non-existing realm using the Thruway client library, I see the following log trace: 2019-05-14T10:36:20.9300870 info [Thruway\Transport\PawlTransportProvider 36156] Starting Transport 2019-05-14T10:36:21.2260120 info [Thruway\Transport\PawlTransportProvider 36156] Pawl has connected 2019-05-14T10:36:21.2487250 debug [Thruway\Transport\PawlTransportProvider 36156] Received: [3,{"message":"no realm \"prod\" exists on this router"},"wamp.error.no_such_realm"] 2019-05-14T10:36:21.2501640 debug [Thruway\Peer\Client 36156] Client onMessage: [Thruway\Message\AbortMessage] 2019-05-14T10:36:21.2503830 info [Thruway\Transport\PawlTransportProvider 36156] Pawl has closed 2019-05-14T10:36:22.7513470 info [Thruway\Transport\PawlTransportProvider 36156] Starting Transport 2019-05-14T10:36:22.9722290 info [Thruway\Transport\PawlTransportProvider 36156] Pawl has connected 2019-05-14T10:36:22.9761750 debug [Thruway\Transport\PawlTransportProvider 36156] Received: [3,{"message":"no realm \"prod\" exists on this router"},"wamp.error.no_such_realm"] 2019-05-14T10:36:22.9763120 debug [Thruway\Peer\Client 36156] Client onMessage: [Thruway\Message\AbortMessage] 2019-05-14T10:36:22.9764230 info [Thruway\Transport\PawlTransportProvider 36156] Pawl has closed ....

And this goes on and on (retying). Is this the desired/expected behaviour? With a 'no_such_realm' error from the router, wouldn't it be more appropriate to throw an exception rather than retrying?

mbonneau commented 4 years ago

Agreed, this should behave differently. I don't have time at the moment to correct this, would welcome a PR.