Can't send a packet with type sptL16_DUAL

Thomas Bosch <[email protected]>
Newsgroups gmane.comp.gnu.ccrtp.devel
Organization TU Berlin
Message-ID <[email protected]>
Hello.

I have written a simple code for testing out the ccrtp library. 
Now I'm wondering why the program hangs at the second send. The sptPCMA packet 
is sent and received correctly, but then the next packet isn't sent. When I 
swap the first and second send everything is okay. 
???
Why?

Thanks a lot


The source ist the following:
-------------------------------------------------------------------------------------------------------------------------------------
#include <iostream>
#include <cstdlib>     
#include <ccrtp/rtp.h>

using namespace std;
using namespace ost;

void sendPacket(RTPSession *socket, StaticPayloadFormat format);
void receivePacket(RTPSession *socket);

int main(int argc, char *argv[])
{
	RTPSession *socket = new RTPSession(InetHostAddress("127.0.0.1"), 8000);
	socket->addDestination(InetHostAddress("127.0.0.1"), 9000);
	socket->startRunning();
	
	RTPSession *socket2 = new RTPSession(InetHostAddress("127.0.0.1"), 9000);
	socket2->addDestination(InetHostAddress("127.0.0.1"), 8000);
	socket2->startRunning();
	
	// first send
	sendPacket(socket2, sptPCMA);
	while(!socket->isWaiting()) sleep(1);
	receivePacket(socket);
	
	// second send
	sendPacket(socket, sptL16_DUAL);
	while(!socket2->isWaiting()) sleep(1);
	receivePacket(socket2);
	
	delete socket;
	delete socket2;
	
  	return EXIT_SUCCESS;
}

void sendPacket(RTPSession *socket, StaticPayloadFormat format)
{
	unsigned char data[1024];
	int ts = socket->getCurrentTimestamp();
	
	socket->setPayloadFormat(StaticPayloadFormat(format));
	socket->putData(ts, data, 1024);
}

void receivePacket(RTPSession *socket)
{
	int ts = socket->getFirstTimestamp();
	const AppDataUnit* adu;
	adu = socket->getData(ts);
	if ( adu != NULL ){
		printf("packet type: %d\n", adu->getType());
	}
}
--------------------------------------------------------------------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.