Commit e941e65f authored by Anne Heimes's avatar Anne Heimes

bugfix recivedByteTatal Error

parent 17506775
......@@ -97,6 +97,8 @@ public:
private:
int m_nMessageType;
int m_nMessageId;
unsigned long m_iBytesReceivedTotal;
VistaByteBufferSerializer m_oOutgoing; //!< Serialization buffer for messages
VistaByteBufferDeSerializer m_oIncoming; //!< Deserialization buffer for messages
std::vector< VistaType::byte > m_vecIncomingBuffer; // Net IO buffer
......
......@@ -144,16 +144,16 @@ bool CITANetAudioMessage::ReadMessage( int timeout)
m_vecIncomingBuffer.resize( nMessagePayloadSize );
// Receive all incoming data (potentially splitted)
int iBytesReceivedTotal = 0;
while( nMessagePayloadSize > iBytesReceivedTotal )
m_iBytesReceivedTotal = 0;
while (nMessagePayloadSize > m_iBytesReceivedTotal)
{
int iIncommingBytes = m_pConnection->WaitForIncomingData( 0 );
int iBytesReceived;
if ( nMessagePayloadSize < iIncommingBytes )
iBytesReceived = m_pConnection->Receive( &m_vecIncomingBuffer[ iBytesReceivedTotal ], nMessagePayloadSize - iBytesReceivedTotal );
iBytesReceived = m_pConnection->Receive(&m_vecIncomingBuffer[m_iBytesReceivedTotal], nMessagePayloadSize - m_iBytesReceivedTotal);
else
iBytesReceived = m_pConnection->Receive( &m_vecIncomingBuffer[ iBytesReceivedTotal ], iIncommingBytes );
iBytesReceivedTotal += iBytesReceived;
iBytesReceived = m_pConnection->Receive(&m_vecIncomingBuffer[m_iBytesReceivedTotal], iIncommingBytes);
m_iBytesReceivedTotal += iBytesReceived;
#if NET_AUDIO_SHOW_TRAFFIC
vstr::out() << "[ CITANetAudioMessage ] " << std::setw( 3 ) << std::floor( iBytesReceivedTotal / float( nMessagePayloadSize ) * 100.0f ) << "% transmitted" << std::endl;
#endif
......
......@@ -323,7 +323,7 @@ void CITANetAudioStream::IncrementBlockPointer()
oLog.iFreeSamples = GetRingBufferFreeSamples( );
m_pStreamLogger->log( oLog );
m_pNetAudioStreamingClient->TriggerBlockIncrement();
//m_pNetAudioStreamingClient->TriggerBlockIncrement();
}
int CITANetAudioStream::Transmit( const ITASampleFrame& sfNewSamples, int iNumSamples )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment