qflow / wamp

qt implementation of wamp protocol. Contains both router and client. Could be used from C++ and QML
GNU Lesser General Public License v3.0
9 stars 8 forks source link

Existing session #3

Open VictorKozachek opened 6 years ago

VictorKozachek commented 6 years ago

Hi,

Tell me please, can I set up the existing WAMP session?

For instance, I have some code which connected to WAMP router and has its own session ID and I do not need to login again and I want to use the existing session.

Thanks.

yinzara commented 6 years ago

This is a really difficult feature to implement exactly as you've described and I think you might need to rethink your solution.

What other code is connecting to a WAMP router outside of qflow WAMP?

WAMP is a web socket based subprotocol. If you have some other code that connects to a WAMP router, it must have its own websocket code and therefore its own websocket connection. There is no way that I know of to open another web socket connection to a WAMP server and reestablish an existing session by ID. The design of the WAMP protocol says that a session ends when the connection ends and one connection is for exactly one session and one session is for exactly one connection.

For what you ask to work, somehow you would have to pass a reference to the websocket (or a method for publishing to said websocket) to the WampConnection so that it could have a reference to it as well as the session ID from your session.

What you probably want to do is pass the authentication information between the sessions and establish two separate sessions. You can do that currently using the 'User' property of WampConnection