<< Click to display table of contents >>


Unit MRVType;


  TRVSocketEvent = procedure(Sender : TObject; SessionKey: TRVSessionKey

    MediaTypes: TRVMediaTypes; RemoteSessionKey: TRVSessionKeyof object;

This is the type of the following events:

TRVCamSender.OnConnected, OnConnecting, OnDisconnect, OnConnectError

TRVCamReceiver.OnConnected, OnConnecting, OnDisconnect, OnConnectError


SessionKey equals to the Sender's SessionKey (depending on the component, it is TRVCamSender.SessionKey or TRVCamReceiver.SessionKey). 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.

RemoteSessionKey can be used when a remote side initiates the connection, and this side accepts it (i.e., for events in TRVCamSender, its TCPConnectionType = rvtcpReceiverToSender; for events in TRVCamReceiver, its TCPConnectionType = rvtcpSenderToReceiver). In this case, RemoteSessionKey is a SessionKey property of the remote side, and you can use it to detect reconnections. In the opposite connection mode (when this side initiates the connection, and a remote side accepts it), RemoteSessionKey = 0.

MediaTypes idendifies a data type for this connection. It can be either empty or contain a single data type, see the topics about the events.