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