diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-765F43E2-39E8-53F5-881F-593F379623CA.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-765F43E2-39E8-53F5-881F-593F379623CA.dita Wed Mar 31 11:11:55 2010 +0100 @@ -0,0 +1,25 @@ + + + + + +Sending and Receiving Non-RTP DataThis topic explains how to send and receive non-RTP data packets on the RTP and RTCP sockets.

Exchanging non-RTP data on an RTP socket is one of the techniques you can use to implement NAT traversal (maintaining client-to-client network connections through Network Address Translation gateways).

Sending non-RTP data

The RRtpSession::SendDataL() method does not attach the RTP or RTCP header to the data.

// initialise the data +const TInt KNonRtpBufferMaxLength = 100; +TBuf8<KNonRtpBufferMaxLength> nonRtpData; +nonRtpData.SetLength(KNonRtpBufferMaxLength); +nonRtpData.Fill('Z'); + +TRequestStatus stat; +iServer->rtpSession.SendDataL(ETrue,nonRtpData, stat); + +User::WaitForRequest(stat);
Receiving non-RTP data

By default, when receiving data identified as non-RTP, the RTP stack discards it.

To receive non-RTP data, you need to register for the ENonRtpDataReceived and ENonRtcpDataReceived events. When you register for one of these events, the RTP stack no longer discards the non-RTP data but does not process the data either. To retrieve the data, call the following functions:

  • NonRtpDataL() provides the non-RTP data received by the RTP socket.

    +const TDesC8& des = iServer->rtpSession.NonRtpDataL(); +
  • NonRtcpDataL() provides the non-RTP data received by the RTCP socket.

    +const TDesC8& des = iServer->rtpSession.NonRtcpDataL(); +

To stop receiving non-RTP data, call the DisableNonRtpData() method. The RTP stack cancels your registration to the non-RTP data events and discards the non-RTP packets.

RTP Overview Creating and Managing an RTP session
\ No newline at end of file