diff --git a/src/cg3protocol.cpp b/src/cg3protocol.cpp old mode 100644 new mode 100755 index c8fc8a4..1703e2a --- a/src/cg3protocol.cpp +++ b/src/cg3protocol.cpp @@ -72,6 +72,7 @@ bool CG3Protocol::Init(void) std::cout << "Error opening socket on port UDP" << G3_CONFIG_PORT << " on ip " << g_Reflector.GetListenIp() << std::endl; } +#ifndef DEBUG_NO_G3_ICMP_SOCKET ok &= m_IcmpRawSocket.Open(IPPROTO_ICMP); if ( !ok ) { @@ -85,7 +86,8 @@ bool CG3Protocol::Init(void) m_pPresenceThread = new std::thread(ConfigThread, this); m_pPresenceThread = new std::thread(IcmpThread, this); } - +#endif + // update time m_LastKeepaliveTime.Now(); diff --git a/src/cprotocol.cpp b/src/cprotocol.cpp old mode 100644 new mode 100755 index 12661eb..6054971 --- a/src/cprotocol.cpp +++ b/src/cprotocol.cpp @@ -140,7 +140,7 @@ void CProtocol::OnDvFramePacketIn(CDvFramePacket *Frame, const CIp *Ip) CPacketStream *stream = GetStream(Frame->GetStreamId(), Ip); if ( stream == NULL ) { - std::cout << "Deleting oprhaned Frame Packet with StreamId " << Frame->GetStreamId() << " from " << *Ip << std::endl; + // std::cout << "Deleting oprhaned Last Frame Packet with StreamId " << Frame->GetStreamId() << " from " << *Ip << std::endl; delete Frame; } else @@ -159,7 +159,7 @@ void CProtocol::OnDvLastFramePacketIn(CDvLastFramePacket *Frame, const CIp *Ip) CPacketStream *stream = GetStream(Frame->GetStreamId(), Ip); if ( stream == NULL ) { - std::cout << "Deleting oprhaned Last Frame Packet with StreamId " << Frame->GetStreamId() << " from " << *Ip << std::endl; + // std::cout << "Deleting oprhaned Last Frame Packet with StreamId " << Frame->GetStreamId() << " from " << *Ip << std::endl; delete Frame; } else @@ -168,9 +168,12 @@ void CProtocol::OnDvLastFramePacketIn(CDvLastFramePacket *Frame, const CIp *Ip) stream->Lock(); stream->Push(Frame); stream->Unlock(); - - // and close the stream - g_Reflector.CloseStream(stream); + + // and don't close the stream yet but rely on CheckStreamsTimeout + // mechanism, so the stream will be closed after the queues have + // been sinked out. This avoid last packets to be send back + // to transmitting client (master) + // g_Reflector.CloseStream(stream); } } @@ -266,3 +269,4 @@ uint32 CProtocol::ModuleToDmrDestId(char m) const { return (uint32)(m - 'A')+1; } + diff --git a/src/main.h b/src/main.h old mode 100644 new mode 100755 index 0079e44..2b656f6 --- a/src/main.h +++ b/src/main.h @@ -52,7 +52,7 @@ #define VERSION_MAJOR 2 #define VERSION_MINOR 4 -#define VERSION_REVISION 0 +#define VERSION_REVISION 1 // global ------------------------------------------------------ @@ -63,6 +63,7 @@ //#define DEBUG_NO_ERROR_ON_XML_OPEN_FAIL //#define DEBUG_DUMPFILE +//#define DEBUG_NO_G3_ICMP_SOCKET // reflector ---------------------------------------------------