Brunet.Connections.LocalConnectionOverlord.HandleGetInformation C# (CSharp) Метод

HandleGetInformation() защищенный Метод

protected HandleGetInformation ( Object o, EventArgs ea ) : void
o Object
ea System.EventArgs
Результат void
    protected void HandleGetInformation(Object o, EventArgs ea)
    {
      Channel queue = (Channel) o;
      Hashtable ht = null;
      try {
        RpcResult rpc_reply = (RpcResult) queue.Dequeue();
        ht = (Hashtable) rpc_reply.Result;
      }
      catch {
        // Remote end point doesn't have LocalCO enabled.
        return;
      }

      try {
        string remote_realm = (string) ht["namespace"];
        if(!remote_realm.Equals(_node.Realm)) {
          return;
        }
        ArrayList string_tas = (ArrayList) ht["tas"];
        ArrayList remote_tas = new ArrayList();
        foreach(string ta in string_tas) {
          remote_tas.Add(TransportAddressFactory.CreateInstance(ta));
        }
        _node.UpdateRemoteTAs(remote_tas);

        AHAddress new_address = (AHAddress) AddressParser.Parse((string) ht["address"]);
        lock(_sync) {
          int pos = _local_addresses.BinarySearch(new_address, addr_compare);
          if(pos < 0) {
            pos = ~pos;
            _local_addresses.Insert(pos, new_address);
          }
        }
      }
      catch (Exception e) {
        ProtocolLog.WriteIf(ProtocolLog.Exceptions, "Unexpected exception: " + e);
      }
    }