Brunet.Node.AnnounceThread C# (CSharp) Method

AnnounceThread() protected method

protected AnnounceThread ( ) : void
return void
    protected void AnnounceThread() {
      ProtocolLog.Monitor.SwitchedSetting += MonitorLogSwitch;
      MonitorLogSwitch();
      try {
        IAction queue_item = null;
        bool timedout = false;
        while( 1 == _running ) {
          queue_item = _packet_queue.Dequeue(-1, out timedout);
          _current_action = queue_item;
          queue_item.Start();
        }
      }
      catch(System.InvalidOperationException x) {
        //This is thrown when Dequeue is called on an empty queue
        //which happens when the BlockingQueue is closed, which
        //happens on Disconnect
        if(1 == _running) {
          ProtocolLog.WriteIf(ProtocolLog.Exceptions, String.Format(
            "Running in AnnounceThread got Exception: {0}", x));
        }
      }
      catch(Exception x) {
        ProtocolLog.WriteIf(ProtocolLog.Exceptions, String.Format(
        "ERROR: Exception in AnnounceThread: {0}", x));
      }
      finally {
        ProtocolLog.Monitor.SwitchedSetting -= MonitorLogSwitch;
        MonitorLogOff();
      }
      ProtocolLog.Write(ProtocolLog.NodeLog,
                        String.Format("Node: {0} leaving AnnounceThread",
                                      this.Address));

    }
    /**