Commit a2fd5c37 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Adding more debug print lines

parent d698f099
......@@ -557,8 +557,7 @@ void CVANetNetworkProtocol::ServerSendAnswer( CVANetMessage* )
// nothing to do
}
CVANetMessage* CVANetNetworkProtocol::ClientInitMessage( int nCommandId,
MESSAGE_MODE eMessageMode )
CVANetMessage* CVANetNetworkProtocol::ClientInitMessage( int nCommandId, MESSAGE_MODE eMessageMode )
{
m_nCurrentMessageMode = eMessageMode;
if( eMessageMode == MESSAGE_ALLOWS_BUFFERING && m_bBufferingActive )
......@@ -576,6 +575,11 @@ CVANetMessage* CVANetNetworkProtocol::ClientInitMessage( int nCommandId,
}
void CVANetNetworkProtocol::ClientSendCommand( CVANetMessage* pMessage )
{
#ifdef VANET_NETWORK_COM_PRINT_DEBUG_INFOS
std::cout << "[ VANetMessage ][ DEBUG ] Client is trying to send a commad now" << std::endl;
#endif
if( pMessage != m_pBufferedMessage )
{
int nExceptionMode = -1;
......@@ -597,9 +601,18 @@ void CVANetNetworkProtocol::ClientSendCommand( CVANetMessage* pMessage )
try
{
#ifdef VANET_NETWORK_COM_PRINT_DEBUG_INFOS
std::cout << "[ VANetMessage ][ DEBUG ] Client is contacting the server" << std::endl;
#endif
pMessage->SetExceptionMode( nExceptionMode );
pMessage->WriteMessage();
#ifdef VANET_NETWORK_COM_PRINT_DEBUG_INFOS
std::cout << "[ VANetMessage ][ DEBUG ] Client sent the request and is waiting for a respond" << std::endl;
#endif
if( m_nCurrentMessageMode == MESSAGE_WITH_ANSWER )
{
pMessage->ReadAnswer();
......@@ -624,6 +637,11 @@ void CVANetNetworkProtocol::ClientSendCommand( CVANetMessage* pMessage )
assert( pMessage->GetAnswerType() == VA_NP_SPECIAL_NO_EXCEPTION );
}
}
#ifdef VANET_NETWORK_COM_PRINT_DEBUG_INFOS
std::cout << "[ VANetMessage ][ DEBUG ] Client received answer message, no exception on server side detected" << std::endl;
#endif
}
catch( const VistaExceptionBase& )
{
......
......@@ -84,6 +84,7 @@ public:
IndicateLoopEnd();
return false;
}
VistaTCPSocket* pSocket = m_pServer->GetNextClient( 3 );
if( pSocket == NULL )
{
......@@ -91,12 +92,14 @@ public:
IndicateLoopEnd();
return false;
}
VistaConnectionIP* pConnection = new VistaConnectionIP( pSocket );
pConnection->SetIsBlocking( true );
pConnection->SetByteorderSwapFlag( VistaSerializingToolset::DOES_NOT_SWAP_MULTIBYTE_VALUES );
m_pParent->AddNewClient( pConnection );
pConnection->Close();
delete pConnection;
return false;
};
......
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