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() void CClient::UpdateSocketBufferSize()
{ {
// TEST
static double test = 4;
// just update the socket buffer size if auto setting is enabled, otherwise // just update the socket buffer size if auto setting is enabled, otherwise
// do nothing // do nothing
if ( bDoAutoSockBufSize )
//if ( bDoAutoSockBufSize )
{ {
// we use the time response measurement for the automatic setting // we use the time response measurement for the automatic setting
// Assumptions: // Assumptions:
@ -460,23 +454,12 @@ static double test = 4;
// completely filled // completely filled
const double dHysteresis = 0.3; const double dHysteresis = 0.3;
if ( RespTimeMoAvBuf.IsInitialized() )
//if ( RespTimeMoAvBuf.IsInitialized() )
{ {
// calculate current buffer setting // calculate current buffer setting
// TODO 2* seems not give optimal results, maybe use 3*? // TODO 2* seems not give optimal results, maybe use 3*?
// TEST add 2 buffers
//const double dEstCurBufSet = 2 * GetTimingStdDev(); const double dEstCurBufSet = 2 * GetTimingStdDev() + 2;
// 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;
// upper/lower hysteresis decision // upper/lower hysteresis decision
const int iUpperHystDec = LlconMath().round ( dEstCurBufSet - dHysteresis ); 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 both decisions are equal than use the result
if ( iUpperHystDec == iLowerHystDec ) if ( iUpperHystDec == iLowerHystDec )
{ {
SetSockBufSize ( iUpperHystDec ); SetSockBufSize ( iUpperHystDec );
} }
else 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 ) if ( Channel.GetSockBufSize() != iNumBlocks )
{ {
// set the new socket size // check for valid values
Channel.SetSockBufSize ( iNumBlocks ); 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 // tell the server that size has changed
Channel.CreateJitBufMes ( iNumBlocks ); Channel.CreateJitBufMes ( iNumBlocks );
}
} }
} }
int GetSockBufSize() { return Channel.GetSockBufSize(); } int GetSockBufSize() { return Channel.GetSockBufSize(); }