removed test code
This commit is contained in:
parent
d741bc6e30
commit
b0d0292314
2 changed files with 16 additions and 36 deletions
|
@ -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 )
|
||||
// do nothing
|
||||
if ( bDoAutoSockBufSize )
|
||||
{
|
||||
// we use the time response measurement for the automatic setting
|
||||
// Assumptions:
|
||||
|
@ -459,24 +453,13 @@ static double test = 4;
|
|||
// - only use time response measurement results if averaging buffer is
|
||||
// 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 );
|
||||
|
@ -484,8 +467,7 @@ static double test = 4;
|
|||
|
||||
// if both decisions are equal than use the result
|
||||
if ( iUpperHystDec == iLowerHystDec )
|
||||
{
|
||||
|
||||
{
|
||||
SetSockBufSize ( iUpperHystDec );
|
||||
}
|
||||
else
|
||||
|
@ -500,12 +482,6 @@ static double test = 4;
|
|||
SetSockBufSize ( iUpperHystDec );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static FILE* pFile = fopen("test.dat", "w");
|
||||
fprintf(pFile, "%e %d\n",test,GetSockBufSize());
|
||||
fflush(pFile);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
14
src/client.h
14
src/client.h
|
@ -97,12 +97,16 @@ public:
|
|||
void SetSockBufSize ( const int iNumBlocks )
|
||||
{
|
||||
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(); }
|
||||
|
|
Loading…
Reference in a new issue