-
Notifications
You must be signed in to change notification settings - Fork 45
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
connectUrl
is re-generated each time when it is called
#95
Comments
Hi, according to the SockJS spec the session_id needs to be unique for every session:
So i think this behavior is correct. Do you have a specific issue/use-case as to why you need this to be identical? I am not sure if a reconnect should be considered a new session or not, which is the only scenario i currently can think of where the new generation would not be desirable (although that might still lead to other issues) |
Yes. It should be unique for every session but it also should be permanent for such session, i.e. value should be idempotent. final client = StompClient(); // single session
// somewhere on connecting status
print(client.connectUrl); // one value
// somewhere on connected status
print(client.connectUrl); // second value
// somewhere on disconnected status
print(client.connectUrl); // third value But it should be the same as it is the same client and same session. Let'say I save websocket clients for some other actions in Map where key is |
Thanks. So if i understand correctly you want to have it return the same value that was used while connecting. So it should only regenerate if it actually is in the process of connecting. Correct? If yes, then that is probably reasonable. |
Yes. Correct. As site has its own URL, then the WS connection should have its unique |
I created a PR #96. Maybe you can have a quick look if this looks good to you? |
@MacDeveloper1 I have released a new version including this PR |
The version before
1.0.0
has aurl
value which was initialized once usingSockJsUtils().generateTransportUrl
whenuseSockJS
was set totrue
. In next versions you created a getterconnectUrl
which returns the effective transport URL for each connection. I think it should be unique and permanent for new STOMP connection during the session but nowconnectUrl
is re-generated each time this getter is called.The text was updated successfully, but these errors were encountered: