ccrtp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ccrtp-devel] ccrtp version 0.9 win2k performance


From: Yang, Xu
Subject: [Ccrtp-devel] ccrtp version 0.9 win2k performance
Date: Mon, 18 Mar 2002 09:57:50 -0500

Dear David, Fed,
I am not sure if this is caused by my poor system (pII400 512M mem) or by my
badly tuning. When I send 1000 pkts (512 byte each), I only received ~700 of
them. And the CPU usage is 100% all the time. The rtpsend and rtplisten
example is used during the test. the sender has the following segment in the
code:
                for ( int i = 0; i < count ; i++ ) {
                        putPacket(i*1600,RTP_PAYLOAD_PCMU,
                                  data,strlen((char *)data) + 1);
                        cout << "write" << i << " packets" << endl;
                        ccxx_sleep(200);
                }
Is this the same on linux?

While I try to build a rtp router by combine the rtpsend and rtplisten code,
I lost even more.
Here is the router class, any suggestion? comments?

Thanks

Xu Yang

class Router {
public:
        Router(InetHostAddress& in_ia, tpport_t in_port, InetHostAddress&
out_ia, tpport_t out_port)
        {
                RTPSocket *inRTPSocket = new RTPSocket(in_ia, in_port);
                inRTPSocket->connect(in_ia,5004);

                RTPSocket *outRTPSocket = new
RTPSocket(InetHostAddress("0.0.0.0"));
                outRTPSocket->setTimeout((uint32)0);
                outRTPSocket->setExpired((uint32)1000000);

                if ( outRTPSocket->connect(out_ia,out_port) < 0 ) {
                        cerr << "Could not connect" << endl;
                        exit;
                }

                int i=0;
                for (;;) {
                        //cerr << getFirstTimestamp();

                        if (
inRTPSocket->getPacket(inRTPSocket->getFirstTimestamp(),buffer,SIZE) )
                        {
                                cout << "I got one, buffer= " << buffer <<
endl;
        
outRTPSocket->putPacket(i*1600,RTP_PAYLOAD_PCMU,
        
buffer,strlen((char *)buffer) + 1);
                                cout << "write" << i++ << " packets" <<
endl;

                        }
                        ccxx_sleep(200); 

                }
                delete inRTPSocket;
                delete outRTPSocket;
        }
        
private:
        enum { SIZE = 8192 };
        unsigned char buffer[SIZE];
};




reply via email to

[Prev in Thread] Current Thread [Next in Thread]