Brunet.Node.CheckForStateChange C# (CSharp) Method

CheckForStateChange() protected method

protected CheckForStateChange ( object ct, EventArgs ce_args ) : void
ct object
ce_args System.EventArgs
return void
    protected void CheckForStateChange(object ct, EventArgs ce_args) {
      bool con = this.IsConnected; 
      ConnectionState new_state;
      if( con ) {
        new_state = Node.ConnectionState.Connected;
      }
      else {
        /*
         * The only other state change that is triggered by a Connection
         * or Disconnection event is SeekingConnections
         */
        new_state = Node.ConnectionState.SeekingConnections;
      }
      bool success;
      SetConState(new_state, out success);
      if( success ) {
        SendStateChange(new_state);
      }
    }