Logo Search packages:      
Sourcecode: sbnc version File versions  Download package

RESULT< bool > CCore::RemoveAdditionalListener ( unsigned short  Port  ) 

RemoveAdditionalListener

Removes a listener.

Parameters:
Port the port of the listener

Definition at line 2252 of file Core.cpp.

References Log(), m_AdditionalListeners, and UpdateAdditionalListeners().

Referenced by CClientConnection::ProcessBncCommand().

                                                                {
      for (unsigned int i = 0; i < m_AdditionalListeners.GetLength(); i++) {
            if (m_AdditionalListeners[i].Port == Port) {
                  if (m_AdditionalListeners[i].Listener != NULL) {
                        m_AdditionalListeners[i].Listener->Destroy();
                  }

                  if (m_AdditionalListeners[i].ListenerV6 != NULL) {
                        m_AdditionalListeners[i].ListenerV6->Destroy();
                  }

                  free(m_AdditionalListeners[i].BindAddress);

                  RESULT<bool> Result = m_AdditionalListeners.Remove(i);
                  THROWIFERROR(bool, Result);

                  Log("Removed listener on port %d.", Port);

                  UpdateAdditionalListeners();

                  RETURN(bool, true);
            }
      }

      RETURN(bool, false);
}


Generated by  Doxygen 1.6.0   Back to index