From b9c6d8776668f679edde78e1706f10910c115f01 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Fri, 3 Apr 2020 21:45:36 +0200 Subject: [PATCH] bug fix: server list ping times may not be accurate and client list may not be retrieved --- ChangeLog | 10 ++++++---- src/clientdlg.cpp | 6 +++++- src/global.h | 4 ++-- src/socket.cpp | 2 +- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index bce487eb..d16ea7bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,13 +12,15 @@ - changed the maximum number of clients supported by the server from 20 to 50 -TODO x64 deploy version for Windows -> change deploy script +- Windows installer now contains a 32 and 64 bit version of Jamulus (the version to + be installed is selected automatically according to the detected operating system) + +- bug fix: server list ping times may not be accurate and client list may not be retrieved + TODO client: larger sound card buffers are managed by conversion buffer, not in processintern for loop (note iSndCrdFrameSizeFactor!) -TODO check why for some servers we do not get client list in server list - -TODO check server list registration for correct behavior +TODO #12 A server in the same NAT region as the client is not visible (https://sourceforge.net/p/llcon/bugs/12/) diff --git a/src/clientdlg.cpp b/src/clientdlg.cpp index b6005788..39551f3a 100755 --- a/src/clientdlg.cpp +++ b/src/clientdlg.cpp @@ -512,8 +512,12 @@ CClientDlg::CClientDlg ( CClient* pNCliP, QObject::connect ( &ConnectDlg, SIGNAL ( ReqServerListQuery ( CHostAddress ) ), this, SLOT ( OnReqServerListQuery ( CHostAddress ) ) ); + // note that this connection must be a queued connection, otherwise the server list ping + // times are not accurate and the client list may not be retrieved for all servers listed + // (it seems the sendto() function needs to be called from different threads to fire the + // packet immediately and do not collect packets before transmitting) QObject::connect ( &ConnectDlg, SIGNAL ( CreateCLServerListPingMes ( CHostAddress ) ), - this, SLOT ( OnCreateCLServerListPingMes ( CHostAddress ) ) ); + this, SLOT ( OnCreateCLServerListPingMes ( CHostAddress ) ), Qt::QueuedConnection ); QObject::connect ( &ConnectDlg, SIGNAL ( CreateCLServerListReqVerAndOSMes ( CHostAddress ) ), this, SLOT ( OnCreateCLServerListReqVerAndOSMes ( CHostAddress ) ) ); diff --git a/src/global.h b/src/global.h index 9db613e2..a6fa0b90 100755 --- a/src/global.h +++ b/src/global.h @@ -110,9 +110,9 @@ LED bar: lbr // defined port number for client and server #if ( SYSTEM_FRAME_SIZE_SAMPLES == 64 ) -# define LLCON_DEFAULT_PORT_NUMBER 22064 // different port number for 64 samples frame size version +# define LLCON_DEFAULT_PORT_NUMBER 22064 // different port number for 64 samples frame size version #else -# define LLCON_DEFAULT_PORT_NUMBER 22124 +# define LLCON_DEFAULT_PORT_NUMBER 22124 #endif // system sample rate (the sound card and audio coder works on this sample rate) diff --git a/src/socket.cpp b/src/socket.cpp index e8910c92..f2a60c02 100755 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -169,7 +169,7 @@ void CSocket::SendPacket ( const CVector& vecbySendBuf, const int iVecSizeOut = vecbySendBuf.Size(); - if ( iVecSizeOut != 0 ) + if ( iVecSizeOut > 0 ) { // send packet through network (we have to convert the constant unsigned // char vector in "const char*", for this we first convert the const