Commit e378f4a8 authored by Anne Heimes's avatar Anne Heimes

bugfix close connection + es werden immernoch zuviele daten geschickt, der...

bugfix close connection + es werden immernoch zuviele daten geschickt, der inclommingvector wird zu groß
parent e941e65f
......@@ -18,6 +18,7 @@ CITANetAudioMessage::CITANetAudioMessage( VistaSerializingToolset::ByteOrderSwap
: m_vecIncomingBuffer( 2048 )
, m_oOutgoing( 2048 )
, m_pConnection( NULL )
, m_iBytesReceivedTotal(0)
{
m_oOutgoing.SetByteorderSwapFlag( bSwapBuffers );
m_oIncoming.SetByteorderSwapFlag( bSwapBuffers );
......@@ -140,11 +141,16 @@ bool CITANetAudioMessage::ReadMessage( int timeout)
// we need at least the two protocol ints
//assert( nMessagePayloadSize >= 2 * sizeof( VistaType::sint32 ) );
if (nMessagePayloadSize > 26000)
{
int i = 0;
}
if( nMessagePayloadSize > ( int ) m_vecIncomingBuffer.size() )
m_vecIncomingBuffer.resize( nMessagePayloadSize );
// Receive all incoming data (potentially splitted)
m_iBytesReceivedTotal = 0;
while (nMessagePayloadSize > m_iBytesReceivedTotal)
{
int iIncommingBytes = m_pConnection->WaitForIncomingData( 0 );
......@@ -158,6 +164,7 @@ bool CITANetAudioMessage::ReadMessage( int timeout)
vstr::out() << "[ CITANetAudioMessage ] " << std::setw( 3 ) << std::floor( iBytesReceivedTotal / float( nMessagePayloadSize ) * 100.0f ) << "% transmitted" << std::endl;
#endif
}
m_iBytesReceivedTotal = 0;
// Transfer data into members
m_oIncoming.SetBuffer( &m_vecIncomingBuffer[ 0 ], nMessagePayloadSize, false );
......
......@@ -321,7 +321,7 @@ void CITANetAudioStream::IncrementBlockPointer()
oLog.dStreamingTimeCode = m_dLastStreamingTimeCode;
oLog.uiBlockId = ++iAudioStreamingBlockID;
oLog.iFreeSamples = GetRingBufferFreeSamples( );
m_pStreamLogger->log( oLog );
//m_pStreamLogger->log( oLog );
//m_pNetAudioStreamingClient->TriggerBlockIncrement();
}
......
......@@ -69,7 +69,7 @@ CITANetAudioStreamingClient::CITANetAudioStreamingClient( CITANetAudioStream* pP
CITANetAudioStreamingClient::~CITANetAudioStreamingClient()
{
//try{
if (m_pConnection->GetIsConnected())
if (m_pConnection != NULL && m_pConnection->GetIsConnected())
{
m_pMessage->ResetMessage();
m_pMessage->SetConnection(m_pConnection);
......
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