diff --git a/src/client.cpp b/src/client.cpp index d3e45c31..889a6187 100755 --- a/src/client.cpp +++ b/src/client.cpp @@ -468,7 +468,10 @@ void CClient::UpdateSocketBufferSize() // if both decisions are equal than use the result if ( iUpperHystDec == iLowerHystDec ) { - SetSockBufSize ( iUpperHystDec ); + // set the socket buffer via the main window thread since somehow + // it gives a protocol deadlock if we call the SetSocketBufSize() + // function directly + PostWinMessage ( MS_SET_JIT_BUF_SIZE, iUpperHystDec ); } else { @@ -477,9 +480,12 @@ void CClient::UpdateSocketBufferSize() if ( !( ( GetSockBufSize() == iUpperHystDec ) || ( GetSockBufSize() == iLowerHystDec ) ) ) { - // the old result is not near the new decision, - // use per definition the upper decision - SetSockBufSize ( iUpperHystDec ); + // The old result is not near the new decision, + // use per definition the upper decision. + // Set the socket buffer via the main window thread since somehow + // it gives a protocol deadlock if we call the SetSocketBufSize() + // function directly. + PostWinMessage ( MS_SET_JIT_BUF_SIZE, iUpperHystDec ); } } } diff --git a/src/global.h b/src/global.h index 1124fe82..5ed13fdf 100755 --- a/src/global.h +++ b/src/global.h @@ -133,6 +133,7 @@ typedef unsigned int _MESSAGE_IDENT; #define MS_PACKET_RECEIVED 5 #define MS_PROTOCOL 6 #define MS_ERROR_IN_THREAD 7 +#define MS_SET_JIT_BUF_SIZE 8 #define MUL_COL_LED_RED 0 #define MUL_COL_LED_YELLOW 1 diff --git a/src/llconclientdlg.cpp b/src/llconclientdlg.cpp index f221d5cd..2c556bf2 100755 --- a/src/llconclientdlg.cpp +++ b/src/llconclientdlg.cpp @@ -369,7 +369,7 @@ void CLlconClientDlg::customEvent ( QEvent* Event ) if ( Event->type() == QEvent::User + 11 ) { const int iMessType = ( (CLlconEvent*) Event )->iMessType; - const int iStatus = ( (CLlconEvent*) Event )->iStatus; + const int iStatus = ( (CLlconEvent*) Event )->iStatus; switch ( iMessType ) { @@ -377,7 +377,6 @@ void CLlconClientDlg::customEvent ( QEvent* Event ) case MS_SOUND_OUT: case MS_JIT_BUF_PUT: case MS_JIT_BUF_GET: - // show overall status -> if any LED goes red, this LED will go red LEDOverallStatus->SetLight ( iStatus ); break; @@ -385,6 +384,9 @@ void CLlconClientDlg::customEvent ( QEvent* Event ) case MS_RESET_ALL: LEDOverallStatus->Reset(); break; + + case MS_SET_JIT_BUF_SIZE: + pClient->SetSockBufSize ( iStatus ); } // update general settings dialog, too