removed test code

This commit is contained in:
Volker Fischer 2009-02-11 18:45:22 +00:00
parent d741bc6e30
commit b0d0292314
2 changed files with 16 additions and 36 deletions

View file

@ -436,15 +436,9 @@ void CClient::UpdateTimeResponseMeasurement()
void CClient::UpdateSocketBufferSize()
{
// TEST
static double test = 4;
// just update the socket buffer size if auto setting is enabled, otherwise
// do nothing
//if ( bDoAutoSockBufSize )
if ( bDoAutoSockBufSize )
{
// we use the time response measurement for the automatic setting
// Assumptions:
@ -460,23 +454,12 @@ static double test = 4;
// completely filled
const double dHysteresis = 0.3;
//if ( RespTimeMoAvBuf.IsInitialized() )
if ( RespTimeMoAvBuf.IsInitialized() )
{
// calculate current buffer setting
// TODO 2* seems not give optimal results, maybe use 3*?
//const double dEstCurBufSet = 2 * GetTimingStdDev();
// TEST
test = test + 0.01 * (2*LlconMath().round ( (double)rand()/RAND_MAX )-1);
if ( test < 0.5 ) test = 0.5;
if ( test > 10 ) test = 10;
const double dEstCurBufSet = test;
// TEST add 2 buffers
const double dEstCurBufSet = 2 * GetTimingStdDev() + 2;
// upper/lower hysteresis decision
const int iUpperHystDec = LlconMath().round ( dEstCurBufSet - dHysteresis );
@ -485,7 +468,6 @@ static double test = 4;
// if both decisions are equal than use the result
if ( iUpperHystDec == iLowerHystDec )
{
SetSockBufSize ( iUpperHystDec );
}
else
@ -501,11 +483,5 @@ static double test = 4;
}
}
}
static FILE* pFile = fopen("test.dat", "w");
fprintf(pFile, "%e %d\n",test,GetSockBufSize());
fflush(pFile);
}
}

View file

@ -98,11 +98,15 @@ public:
{
if ( Channel.GetSockBufSize() != iNumBlocks )
{
// set the new socket size
Channel.SetSockBufSize ( iNumBlocks );
// check for valid values
if ( ( iNumBlocks >= 0 ) && ( iNumBlocks <= MAX_NET_BUF_SIZE_NUM_BL ) )
{
// set the new socket size
Channel.SetSockBufSize ( iNumBlocks );
// tell the server that size has changed
Channel.CreateJitBufMes ( iNumBlocks );
// tell the server that size has changed
Channel.CreateJitBufMes ( iNumBlocks );
}
}
}
int GetSockBufSize() { return Channel.GetSockBufSize(); }