I've started experimenting with Janus, and for most part it's easy to understand. But one thing that isn't really documented is exactly what sessions and handles are. By looking through the code I see that `createSession()` is called within the Janus.js Janus() constructor to connect user over http/ws, and when this connection is successfull `createHandle()` is called within Janus.attach() when attaching to a plugin, so by this I'm left to guess that sessions are associated with the users connection with Janus service (over Websocket or REST for example), and handles are associated with the users connection with the plugin (datachannel, media tracks, etc). But this is just guessing from the code, and to make matters more confusing the documents hint that a user can have multiple sessions at once (more than one tab? more than one peerconnection?) and that users can also have more than one handle (multiple datachannels/media stream within a single peerconnection? multiple peerconnections? [docs aren't specific that peerconnections are linked to sessions - that is just a guess]). Can anybody detail what Janus sessions are as well as Janus handles? Thank you.
edit: looking into the Janus server side API and server side code I see that it uses multiple definitions of handles (gateway handle, plugin handle, core handle). Plugin handle I can understand, since this will basically be the context of a connection into a specific video room etc, so multiple handles from the plugin perspective would then allow a user to participate in more than one room at once within the same plugin, which is understandable. But when trying to fit the idea of core/gateway handles into this it breaks how I thought I understood it. At that point they start to resemble the context of how I think sessions are being used. So this not only changes how I need to understand Janus handles but also Janus sessions as well :/
second edit: While surfing the Janus codebase I also found that 'seesion' tends to be used in multiple contexts as well (user, plugin, ext). This matters because I am brainstorming the possibility of creating Janus plugins. So my main questions:
- When if comes to higher level usage, ie Janus.js and Janus's basic JSON API's, what is the most important concepts to understand in Janus sessions and Janus handles?
- On the deeper level, what are plugin sessions/plugin handles (as well as gateway handles, etc) and how do they differ from the concepts in what could be considered higer level userspace sessions/handles?