The events occur before and after opening a connection for the specific media type.
property OnOpenChannel: TRVSocketEvent;
property OnCloseChannel: TRVSocketEvent;
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. When all channels are opened, a session is established.
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.
The sequence of events on (successful) connection:
The sequence of events on disconnection
1.For each channel: OnDisconnect, then OnCloseChannel;
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.