diff --git a/ambed/ccontroller.cpp b/ambed/ccontroller.cpp index 73d54e6..691d102 100644 --- a/ambed/ccontroller.cpp +++ b/ambed/ccontroller.cpp @@ -213,27 +213,6 @@ CStream *CController::OpenStream(const CCallsign &Callsign, const CIp &Ip, uint8 return stream; } -void CController::CloseStream(CStream *stream) -{ - Lock(); - // look for the stream - for ( auto it=m_Streams.begin(); it!=m_Streams.end(); it++ ) - { - // compare object pointers - if ( *it == stream ) - { - // close it - (*it)->Close(); - // remove it - //std::cout << "Stream " << m_Streams[i]->GetId() << " removed" << std::endl; - delete *it; - m_Streams.erase(it); - break; - } - } - Unlock(); -} - void CController::CloseStream(uint16 StreamId) { Lock(); diff --git a/ambed/ccontroller.h b/ambed/ccontroller.h index 95c637d..cbbfd85 100644 --- a/ambed/ccontroller.h +++ b/ambed/ccontroller.h @@ -55,16 +55,15 @@ public: // set void SetListenIp(const char *str) { memset(m_addr, 0, INET6_ADDRSTRLEN); strncpy(m_addr, str, INET6_ADDRSTRLEN-1); } - // streams management - CStream *OpenStream(const CCallsign &, const CIp &, uint8, uint8); - void CloseStream(CStream *); - void CloseStream(uint16); - // task static void Thread(CController *); void Task(void); protected: + // streams management + CStream *OpenStream(const CCallsign &, const CIp &, uint8, uint8); + void CloseStream(uint16); + // packet decoding helpers bool IsValidKeepAlivePacket(const CBuffer &, CCallsign *); bool IsValidOpenstreamPacket(const CBuffer &, CCallsign *, uint8 *, uint8 *); @@ -79,7 +78,6 @@ protected: bool IsValidCodecIn(uint8); bool IsValidCodecOut(uint8); -protected: // control socket char m_addr[INET6_ADDRSTRLEN]; CUdpSocket m_Socket;