From 27f0e540b6c33f49a7cc1605c0b3615019ee3b6c Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Mon, 6 Jan 2014 12:52:53 +0000 Subject: [PATCH] make the "ParseMessageBody" signal/slot mechanism the default since in the future we will need to use different threads at some point --- src/channel.cpp | 11 ----------- src/channel.h | 10 +++++----- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/channel.cpp b/src/channel.cpp index b4cce864..6ee79324 100755 --- a/src/channel.cpp +++ b/src/channel.cpp @@ -105,13 +105,11 @@ QObject::connect ( &Protocol, SIGNAL ( ReqNetTranspProps() ), this, SLOT ( OnReqNetTranspProps() ) ); -#ifdef ENABLE_RECEIVE_SOCKET_IN_SEPARATE_THREAD // this connection is intended for a thread transition if we have a // separate socket thread running QObject::connect ( this, SIGNAL ( ParseMessageBody ( CVector, int, int ) ), this, SLOT ( OnParseMessageBody ( CVector, int, int ) ) ); -#endif } bool CChannel::ProtocolIsEnabled() @@ -483,7 +481,6 @@ EPutDataStat CChannel::PutData ( const CVector& vecbyData, } else { -#ifdef ENABLE_RECEIVE_SOCKET_IN_SEPARATE_THREAD // parse the message assuming this is a regular protocol message emit ParseMessageBody ( vecbyMesBodyData, iRecCounter, iRecID ); @@ -491,14 +488,6 @@ EPutDataStat CChannel::PutData ( const CVector& vecbyData, // check if the protocol was ok since we emit just a signal // and do not get any feedback on the protocol decoding state eRet = PS_PROT_OK; -#else - // parse the message assuming this is a protocol message - if ( !Protocol.ParseMessageBody ( vecbyMesBodyData, iRecCounter, iRecID ) ) - { - // set status flag - eRet = PS_PROT_OK; - } -#endif } } else diff --git a/src/channel.h b/src/channel.h index fddd96a9..22226ba7 100755 --- a/src/channel.h +++ b/src/channel.h @@ -208,11 +208,13 @@ public slots: void OnNetTranspPropsReceived ( CNetworkTransportProps NetworkTransportProps ); void OnReqNetTranspProps(); -#ifdef ENABLE_RECEIVE_SOCKET_IN_SEPARATE_THREAD void OnParseMessageBody ( CVector vecbyMesBodyData, int iRecCounter, - int iRecID ) { Protocol.ParseMessageBody ( vecbyMesBodyData, iRecCounter, iRecID ); } -#endif + int iRecID ) + { + // note that the return value is ignored here + Protocol.ParseMessageBody ( vecbyMesBodyData, iRecCounter, iRecID ); + } signals: void MessReadyForSending ( CVector vecMessage ); @@ -233,11 +235,9 @@ signals: void DetectedCLMessage ( CVector vecbyMesBodyData, int iRecID ); -#ifdef ENABLE_RECEIVE_SOCKET_IN_SEPARATE_THREAD void ParseMessageBody ( CVector vecbyMesBodyData, int iRecCounter, int iRecID ); -#endif }; #endif /* !defined ( CHANNEL_HOIH9345KJH98_3_4344_BB23945IUHF1912__INCLUDED_ ) */