You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 9, 2018. It is now read-only.
I'm seeing the following scenario as a strong possibility:
Single dispatcher gets created in WampServerEndpointConfig
Client connects, server constructs a new WampServerEndpoint (with the dispatcher)
this calls dispatcher.newConnection(session), which in turn iterates all of the handlers and calls WampMessageHandler.onOpen with the current session id
DefaultRPCSender and DefaultEventSubscriber have onOpen implementations that store the session id, like this (this is from DefaultRPCSender):
@Override
public void onOpen(String sessionId) {
this.sessionId = sessionId;
}
every time a new client connects, the session id stored in each of these handlers is going to change.
I'm pretty sure that bad things will happen as a result.
The fix seems to be to not share Dispatcher across all endpoints. Instead, each session should get it's own dispatcher, so we should configure the ClientEndpoint and ServerEndpointConfig objects with a DispatcherFactory instead. When WampSessions are created, we also create a dispatcher.
What's nice about this change is that dispatcher can be tightly bound to the WampSession object (in fact, it can be a member of WampSession). I believe that this would simplify quite a few of the code paths through jWAMP. For example, instead of passing sessionId around, we can pass the session itself:
instead of
Dispatcher.onMessage(WampMessage, String)
we would have:
Dispatcher.onMessage(WampMessage, WampSession)
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm seeing the following scenario as a strong possibility:
DefaultRPCSender and DefaultEventSubscriber have onOpen implementations that store the session id, like this (this is from DefaultRPCSender):
every time a new client connects, the session id stored in each of these handlers is going to change.
I'm pretty sure that bad things will happen as a result.
The fix seems to be to not share Dispatcher across all endpoints. Instead, each session should get it's own dispatcher, so we should configure the ClientEndpoint and ServerEndpointConfig objects with a DispatcherFactory instead. When WampSessions are created, we also create a dispatcher.
What's nice about this change is that dispatcher can be tightly bound to the WampSession object (in fact, it can be a member of WampSession). I believe that this would simplify quite a few of the code paths through jWAMP. For example, instead of passing sessionId around, we can pass the session itself:
instead of
we would have:
The text was updated successfully, but these errors were encountered: