diff --git a/src/channel.cpp b/src/channel.cpp index 71cc0621..6d5cecfe 100755 --- a/src/channel.cpp +++ b/src/channel.cpp @@ -337,16 +337,19 @@ for (int i = 0; i < BLOCK_SIZE_SAMPLES; i++) } } Mutex.unlock (); /* put mutex unlock */ + + // check if channel was not connected + const bool bChanWasNotConnected = !IsConnected(); + // reset time-out counter + iConTimeOut = CON_TIME_OUT_CNT_MAX; + // if channel was not connected, emit signal to inform that new // connection was established - if ( iConTimeOut == 0 ) + if ( bChanWasNotConnected ) { emit NewConnection(); } - - // reset time-out counter - iConTimeOut = CON_TIME_OUT_CNT_MAX; } else { diff --git a/src/client.cpp b/src/client.cpp index 1a5dc530..7e24455d 100755 --- a/src/client.cpp +++ b/src/client.cpp @@ -51,8 +51,7 @@ for ( int i = 0; i < vecMessage.Size (); i++ ) { // the protocol queries me to call the function to send the message // send it through the network - Socket.SendPacket ( vecbyDataConv, - Channel.GetAddress () ); + Socket.SendPacket ( vecbyDataConv, Channel.GetAddress () ); } bool CClient::SetServerAddr(QString strNAddr) diff --git a/src/server.cpp b/src/server.cpp index 68193d72..9ceae680 100755 --- a/src/server.cpp +++ b/src/server.cpp @@ -60,8 +60,7 @@ for ( int i = 0; i < vecMessage.Size (); i++ ) { // the protocol queries me to call the function to send the message // send it through the network - Socket.SendPacket ( vecbyDataConv, - ChannelSet.GetAddress ( iChID ) ); + Socket.SendPacket ( vecbyDataConv, ChannelSet.GetAddress ( iChID ) ); } void CServer::Start ()