Ignore:
Timestamp:
Feb 13, 2010, 7:56:47 PM (12 years ago)
Author:
arnold
Message:

P2PManager/P2PJobAdmin: Finetuning of leaving and re-joining the network.
Miscellaneous null-Checks implemented, so some p2p-sided errors where catched.

Location:
trunk/CrypPlugins/PeerToPeerBase
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/PeerToPeerBase/IP2PControl.cs

    r1137 r1144  
    7171        Stop = 7,
    7272        /// <summary>
    73         /// because Enum is non-nullable, I used this workaround
     73        /// When a new Publisher A canceled to takeover the Topic of another Publisher B,
     74        /// because B is still active, so A can't takeover functionality of B!
    7475        /// </summary>
    75         NULL = 666
     76        PublisherRivalryProblem = 8,
     77        /// <summary>
     78        /// Only send this msg type, when a fatal error occured at Publisher or Subscriber
     79        /// </summary>
     80        Error = 222
    7681    }
    7782
  • trunk/CrypPlugins/PeerToPeerBase/P2PPeer.cs

    r1137 r1144  
    5151        {
    5252            this.p2pBase = new P2PBase();
    53             // to forward event from overlay/dht MessageReceived-Event from P2PBase
    54             this.p2pBase.OnP2PMessageReceived += new P2PBase.P2PMessageReceived(p2pBase_OnP2PMessageReceived);
    5553            this.settings = new P2PPeerSettings(this);
    5654            this.settings.TaskPaneAttributeChanged += new TaskPaneAttributeChangedHandler(settings_TaskPaneAttributeChanged);
     
    212210
    213211                this.p2pBase.AllowLoggingToMonitor = this.settings.Log2Monitor;
     212
     213                // to forward event from overlay/dht MessageReceived-Event from P2PBase
     214                this.p2pBase.OnP2PMessageReceived += new P2PBase.P2PMessageReceived(p2pBase_OnP2PMessageReceived);
    214215
    215216                if (CheckAndInstallPAPCertificates())
     
    253254                else
    254255                {
     256                    this.p2pBase.OnP2PMessageReceived -= p2pBase_OnP2PMessageReceived;
    255257                    this.settings.PeerStatusChanged(P2PPeerSettings.PeerStatus.NotConnected);
    256258                    GuiLogMessage("Peer stopped: " + !this.PeerStarted, NotificationLevel.Info);
  • trunk/CrypPlugins/PeerToPeerBase/PeerToPeerBase.cs

    r1129 r1144  
    675675        public PeerId(OverlayAddress oAddress)
    676676        {
    677             this.stringId = oAddress.ToString();
    678             this.byteId = oAddress.ToByteArray();
    679 
    680             // FNV-1 hashing
    681             uint fnvHash = OFFSET_BASIS;
    682             foreach (byte b in byteId)
    683             {
    684                 fnvHash = (fnvHash * PRIME) ^ b;
    685             }
    686             hashCode = (int)fnvHash;
     677            if (oAddress != null)
     678            {
     679                this.stringId = oAddress.ToString();
     680                this.byteId = oAddress.ToByteArray();
     681
     682                // FNV-1 hashing
     683                uint fnvHash = OFFSET_BASIS;
     684                foreach (byte b in byteId)
     685                {
     686                    fnvHash = (fnvHash * PRIME) ^ b;
     687                }
     688                hashCode = (int)fnvHash;
     689            }
    687690        }
    688691
Note: See TracChangeset for help on using the changeset viewer.