TRVCamReceiver.OnOpenChannel, OnCloseChannel

<< Click to display table of contents >>

TRVCamReceiver.OnOpenChannel, OnCloseChannel

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:

1.For each channel: OnOpenChannel, then OnConnecting, then OnConnected;

2.OnSessionConnected.

The sequence of events on disconnection

1.For each channel: OnDisconnect, then OnCloseChannel;

2.OnSessionDisconnected.

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.

See also

GetOpenChannelCount, GetMaxChannelCount