server bug fix: channel name was not reset on new connection leading to be the old name assigned to new client
This commit is contained in:
parent
9a03b9e172
commit
44be809457
3 changed files with 7 additions and 1 deletions
|
@ -28,7 +28,6 @@
|
||||||
/* Implementation *************************************************************/
|
/* Implementation *************************************************************/
|
||||||
CChannel::CChannel ( const bool bNIsServer ) :
|
CChannel::CChannel ( const bool bNIsServer ) :
|
||||||
bIsServer ( bNIsServer ),
|
bIsServer ( bNIsServer ),
|
||||||
sName ( "" ),
|
|
||||||
vecdGains ( USED_NUM_CHANNELS, (double) 1.0 ),
|
vecdGains ( USED_NUM_CHANNELS, (double) 1.0 ),
|
||||||
bIsEnabled ( false ),
|
bIsEnabled ( false ),
|
||||||
iNetwFrameSizeFact ( FRAME_SIZE_FACTOR_DEFAULT ),
|
iNetwFrameSizeFact ( FRAME_SIZE_FACTOR_DEFAULT ),
|
||||||
|
@ -49,6 +48,9 @@ CChannel::CChannel ( const bool bNIsServer ) :
|
||||||
CycleTimeVariance.Init ( SYSTEM_FRAME_SIZE_SAMPLES,
|
CycleTimeVariance.Init ( SYSTEM_FRAME_SIZE_SAMPLES,
|
||||||
SYSTEM_SAMPLE_RATE, TIME_MOV_AV_RESPONSE );
|
SYSTEM_SAMPLE_RATE, TIME_MOV_AV_RESPONSE );
|
||||||
|
|
||||||
|
// initialize channel name
|
||||||
|
ResetName();
|
||||||
|
|
||||||
|
|
||||||
// connections -------------------------------------------------------------
|
// connections -------------------------------------------------------------
|
||||||
QObject::connect ( &Protocol,
|
QObject::connect ( &Protocol,
|
||||||
|
|
|
@ -77,6 +77,7 @@ public:
|
||||||
bool GetAddress ( CHostAddress& RetAddr );
|
bool GetAddress ( CHostAddress& RetAddr );
|
||||||
CHostAddress GetAddress() const { return InetAddr; }
|
CHostAddress GetAddress() const { return InetAddr; }
|
||||||
|
|
||||||
|
void ResetName() { sName = ""; } // reset does not emit a message
|
||||||
void SetName ( const QString sNNa );
|
void SetName ( const QString sNNa );
|
||||||
QString GetName();
|
QString GetName();
|
||||||
|
|
||||||
|
|
|
@ -643,6 +643,9 @@ bool CServer::PutData ( const CVector<uint8_t>& vecbyRecBuf,
|
||||||
// address
|
// address
|
||||||
vecChannels[iCurChanID].SetAddress ( HostAdr );
|
vecChannels[iCurChanID].SetAddress ( HostAdr );
|
||||||
|
|
||||||
|
// reset channel name
|
||||||
|
vecChannels[iCurChanID].ResetName();
|
||||||
|
|
||||||
// reset the channel gains of current channel, at the same
|
// reset the channel gains of current channel, at the same
|
||||||
// time reset gains of this channel ID for all other channels
|
// time reset gains of this channel ID for all other channels
|
||||||
for ( int i = 0; i < USED_NUM_CHANNELS; i++ )
|
for ( int i = 0; i < USED_NUM_CHANNELS; i++ )
|
||||||
|
|
Loading…
Reference in a new issue