Ignore:
Timestamp:
Feb 2, 2010, 6:09:57 PM (12 years ago)
Author:
arnold
Message:

P2PBase: SuperNode-Killing fixed (so P@P-DLLs were updated)
P2PPublisher: Publisher-Exchange now possible, particularly when "old" Publisher takes a "french leave"
P2PJobs: New Architecture for future use of a generic Manager/Worker-infrastructure
KeySearcher: KeyPattern and KeyPatternPool now inherit from P2PJobs (IJobPart, IJobStack)

Location:
trunk/CrypPlugins/PeerToPeerBase
Files:
40 edited

Legend:

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

    r1098 r1129  
    1111    {
    1212        private static Encoding enc = Encoding.UTF8;
     13        private static string PublishersTimeStamp = "PubTimeStamp";
    1314        private static string AliveMsg = "AliveMsg";
    1415        private static string EncryptedData = "EncryptedText";
     
    157158            bool id = p2pControl.DHTremove(sTopicName);
    158159            bool alive = p2pControl.DHTremove(sTopicName + AliveMsg);
     160            bool timestamp = p2pControl.DHTremove(sTopicName + PublishersTimeStamp);
     161            //if timestamp wasn't removed successfully, that's no problem!
    159162            return (id && alive);
    160163        }
     
    172175            return (encrypt && init);
    173176        }
     177
     178        // new stuff - Arnie 2010.02.02
     179       
     180        ///// <summary>
     181        ///// Sets or updates the TimeStamp for the actual Publisher
     182        ///// </summary>
     183        ///// <param name="p2pControl">necessary P2PControl to use DHT operation(s)</param>
     184        ///// <param name="sTopicName">the topic name on which all Peers are registered</param>
     185        ///// <returns>true, if storing succeeds, otherwise false</returns>
     186        //public static bool SetPublishersTimeStamp(ref IP2PControl p2pControl, string sTopicName)
     187        //{
     188        //    byte[] timeStamp = enc.GetBytes(DateTime.Now.ToString());
     189        //    bool store = p2pControl.DHTstore(sTopicName + PublishersTimeStamp, timeStamp);
     190        //}
     191
     192        ///// <summary>
     193        /////  Gets the TimeStamp for the actual Publisher, if it's stored in the DHT (when a Publisher
     194        /////  is active, this value have to be occupied). Otherwise, when no Publisher is active, returns null.
     195        /////  If the DHT value is occupied, but parsing to DateTime wasn't possible, an Exception will be thrown
     196        ///// </summary>
     197        ///// <param name="p2pControl">necessary P2PControl to use DHT operation(s)</param>
     198        ///// <param name="sTopicName">the topic name on which all Peers are registered</param>
     199        ///// <returns>DateTime, if DHT entry is occupied, otherwise false.</returns>
     200        //public static DateTime GetPublishersTimeStamp(ref IP2PControl p2pControl, string sTopicName)
     201        //{
     202        //    DateTime retTimeStamp = null;
     203        //    byte[] timeStamp = p2pControl.DHTload(sTopicName + PublishersTimeStamp);
     204        //    //when timeStamp is null, DHT entry isn't occupied --> No Publisher is active at present
     205        //    if (timeStamp != null)
     206        //    {
     207        //        string sTimeStamp = enc.GetString(timeStamp);
     208        //        // if parsing isn't possible though DHT entry is occupied, throw an exception
     209        //        if (!DateTime.TryParse(sTimeStamp, out retTimeStamp))
     210        //        {
     211        //            throw (new Exception("Parsing the DHT entry '" + sTopicName + PublishersTimeStamp
     212        //                + "' to DateTime wasn't possible. Value: '" + sTimeStamp + "'"));
     213        //        }
     214        //    }
     215        //    return retTimeStamp;
     216        //}
    174217    }
    175218}
     219
  • trunk/CrypPlugins/PeerToPeerBase/PeerToPeerBase.cs

    r1115 r1129  
    165165            {
    166166                case P2PLinkManagerType.Snal:
    167                     if (bsType == P2PBootstrapperType.LocalMachineBootstrapper)
    168                         throw (new Exception("It's mindless to activate NAT traversal, but use the LocalMachineBootstrapper."));
    169 
    170167                    LogToMonitor("Init LinkMgr: Using NAT Traversal stuff");
    171168                    // NAT-Traversal stuff needs a different Snal-Version
Note: See TracChangeset for help on using the changeset viewer.