@@ -436,7 +436,14 @@ CONNECTION LESS MESSAGES
436436
437437- PROTMESSID_CLM_TCP_SUPPORTED: TCP supported message
438438
439- note: does not have any data -> n = 0
439+ +----------------------------------------------------------+
440+ | 2 bytes ID of message to be potentially retried over TCP |
441+ +----------------------------------------------------------+
442+
443+ the ID indicates which type of message preceded it:
444+ - PROTMESSID_CLM_SERVER_LIST
445+ - PROTMESSID_CLM_CONN_CLIENTS_LIST
446+ - 0 (sent on new incoming audio stream)
440447
441448*/
442449
@@ -931,7 +938,7 @@ void CProtocol::ParseConnectionLessMessageBody ( const CVector<uint8_t>& vecbyMe
931938 break ;
932939
933940 case PROTMESSID_CLM_TCP_SUPPORTED:
934- EvaluateCLTcpSupportedMes ( InetAddr );
941+ EvaluateCLTcpSupportedMes ( InetAddr, vecbyMesBodyData );
935942 break ;
936943 }
937944}
@@ -2596,15 +2603,31 @@ bool CProtocol::EvaluateCLRegisterServerResp ( const CHostAddress& InetAddr, con
25962603 return false ; // no error
25972604}
25982605
2599- void CProtocol::CreateCLTcpSupportedMes ( const CHostAddress& InetAddr )
2606+ void CProtocol::CreateCLTcpSupportedMes ( const CHostAddress& InetAddr, const int iID )
26002607{
2601- CreateAndImmSendConLessMessage ( PROTMESSID_CLM_TCP_SUPPORTED, CVector<uint8_t > ( 0 ), InetAddr );
2608+ int iPos = 0 ; // init position pointer
2609+
2610+ // build data vector (2 bytes long)
2611+ CVector<uint8_t > vecData ( 2 );
2612+
2613+ // message ID just sent (2 bytes)
2614+ PutValOnStream ( vecData, iPos, static_cast <uint32_t > ( iID ), 2 );
2615+
2616+ CreateAndImmSendConLessMessage ( PROTMESSID_CLM_TCP_SUPPORTED, vecData, InetAddr );
26022617}
26032618
2604- bool CProtocol::EvaluateCLTcpSupportedMes ( const CHostAddress& InetAddr )
2619+ bool CProtocol::EvaluateCLTcpSupportedMes ( const CHostAddress& InetAddr, const CVector< uint8_t >& vecData )
26052620{
2621+ int iPos = 0 ; // init position pointer
2622+
2623+ // check size
2624+ if ( vecData.Size () != 2 )
2625+ {
2626+ return true ; // return error code
2627+ }
2628+
26062629 // invoke message action
2607- emit CLTcpSupported ( InetAddr );
2630+ emit CLTcpSupported ( InetAddr, static_cast < int > ( GetValFromStream ( vecData, iPos, 2 ) ) );
26082631
26092632 return false ; // no error
26102633}
0 commit comments