<< Click to display table of contents >>
The events occur when all channels are connected/disconnected.
type // Defined in MRVType unit
TRVSessionEvent = procedure(Sender: TObject;
SessionKey: TRVSessionKey) of object;
property OnSessionConnected: TRVSessionEvent;
property OnSessionDisconnected: TRVSessionEvent;
Channels and sessions are used only when a receiver initiates a connection to a sender/server. See the topic about the modes of connections for the explanations.
A channel is a connection for transferring data of one of media types. A receiver can accept up to 5 media types, specified in ReceiveMediaTypes property (even of TRVCamSender does not send some of these data, channels are still opened). These channels make up a session. When all channels are opened, a session is created (and OnSessionConnected occurs). If at least one channel is closed, a session is terminated (and OnSessionDisconnected occurs).
OnSessionDisconnected occurs after an unsuccessful attempt to connect as well (without calling OnSessionConnected).
If you perform time consuming operations inside an event, it makes sense to compare values of SessionKey parameter and SessionKey property, to make sure that a connection was not closed or reopened.