Commit e941e65f authored by Anne Heimes's avatar Anne Heimes

bugfix recivedByteTatal Error

parent 17506775
...@@ -97,6 +97,8 @@ public: ...@@ -97,6 +97,8 @@ public:
private: private:
int m_nMessageType; int m_nMessageType;
int m_nMessageId; int m_nMessageId;
unsigned long m_iBytesReceivedTotal;
VistaByteBufferSerializer m_oOutgoing; //!< Serialization buffer for messages VistaByteBufferSerializer m_oOutgoing; //!< Serialization buffer for messages
VistaByteBufferDeSerializer m_oIncoming; //!< Deserialization buffer for messages VistaByteBufferDeSerializer m_oIncoming; //!< Deserialization buffer for messages
std::vector< VistaType::byte > m_vecIncomingBuffer; // Net IO buffer std::vector< VistaType::byte > m_vecIncomingBuffer; // Net IO buffer
......
...@@ -144,16 +144,16 @@ bool CITANetAudioMessage::ReadMessage( int timeout) ...@@ -144,16 +144,16 @@ bool CITANetAudioMessage::ReadMessage( int timeout)
m_vecIncomingBuffer.resize( nMessagePayloadSize ); m_vecIncomingBuffer.resize( nMessagePayloadSize );
// Receive all incoming data (potentially splitted) // Receive all incoming data (potentially splitted)
int iBytesReceivedTotal = 0; m_iBytesReceivedTotal = 0;
while( nMessagePayloadSize > iBytesReceivedTotal ) while (nMessagePayloadSize > m_iBytesReceivedTotal)
{ {
int iIncommingBytes = m_pConnection->WaitForIncomingData( 0 ); int iIncommingBytes = m_pConnection->WaitForIncomingData( 0 );
int iBytesReceived; int iBytesReceived;
if ( nMessagePayloadSize < iIncommingBytes ) if ( nMessagePayloadSize < iIncommingBytes )
iBytesReceived = m_pConnection->Receive( &m_vecIncomingBuffer[ iBytesReceivedTotal ], nMessagePayloadSize - iBytesReceivedTotal ); iBytesReceived = m_pConnection->Receive(&m_vecIncomingBuffer[m_iBytesReceivedTotal], nMessagePayloadSize - m_iBytesReceivedTotal);
else else
iBytesReceived = m_pConnection->Receive( &m_vecIncomingBuffer[ iBytesReceivedTotal ], iIncommingBytes ); iBytesReceived = m_pConnection->Receive(&m_vecIncomingBuffer[m_iBytesReceivedTotal], iIncommingBytes);
iBytesReceivedTotal += iBytesReceived; m_iBytesReceivedTotal += iBytesReceived;
#if NET_AUDIO_SHOW_TRAFFIC #if NET_AUDIO_SHOW_TRAFFIC
vstr::out() << "[ CITANetAudioMessage ] " << std::setw( 3 ) << std::floor( iBytesReceivedTotal / float( nMessagePayloadSize ) * 100.0f ) << "% transmitted" << std::endl; vstr::out() << "[ CITANetAudioMessage ] " << std::setw( 3 ) << std::floor( iBytesReceivedTotal / float( nMessagePayloadSize ) * 100.0f ) << "% transmitted" << std::endl;
#endif #endif
......
...@@ -323,7 +323,7 @@ void CITANetAudioStream::IncrementBlockPointer() ...@@ -323,7 +323,7 @@ void CITANetAudioStream::IncrementBlockPointer()
oLog.iFreeSamples = GetRingBufferFreeSamples( ); oLog.iFreeSamples = GetRingBufferFreeSamples( );
m_pStreamLogger->log( oLog ); m_pStreamLogger->log( oLog );
m_pNetAudioStreamingClient->TriggerBlockIncrement(); //m_pNetAudioStreamingClient->TriggerBlockIncrement();
} }
int CITANetAudioStream::Transmit( const ITASampleFrame& sfNewSamples, int iNumSamples ) 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