Next: , Up: ccRTP Overview


3.1 Simple Transmitter

The following snippet illustrates the required steps to send an application data unit over RTP.

     RTPSession s(InetHostAddress("127.0.0.1"),8000);  // bind reception socket
     
     // Initialization
     cout << "Local SSRC identifier: " << s.getLocalSSRC() << endl;
     s.addDestination("www.example.com",9000); // set one destination for packets
     s.setPayloadFormat(staticPayloadFormat(sptPCMU));
     s.startRunning(); // start running the packet queue scheduler
     
     // Send data
     s.putData(0,buffer,bufferLen); // buffer holds bufferLen payload octets