Ignore:
Timestamp:
May 2, 2010, 1:43:33 PM (12 years ago)
Author:
Paul Lelgemann
Message:

+ Added P2P connection to CrypP2P based on PeerToPeerBase plugin (using default settings)
+ Added MD5Collider to CoreDeveloper solution

Location:
trunk/CrypP2P/Internal
Files:
1 added
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/CrypP2P/Internal/P2PBase.cs

    r1370 r1374  
    5656 * - Testing asynchronous methods incl. EventHandlers
    5757 */
    58 namespace Cryptool.Plugins.PeerToPeer
     58namespace Cryptool.P2P.Internal
    5959{
    6060    /* Advantages of this wrapper class:
     
    108108        /// If true, all kinds of actions will be logged in the PeersAtPlay LogMonitor.
    109109        /// </summary>
    110         public bool AllowLoggingToMonitor 
     110        public bool AllowLoggingToMonitor
    111111        {
    112112            get { return this.allowLoggingToMonitor; }
     
    120120        /// True if system was successfully joined, false if system is COMPLETELY left
    121121        /// </summary>
    122         public bool Started 
     122        public bool Started
    123123        {
    124124            get { return this.started; }
    125             private set { this.started = value; } 
     125            private set { this.started = value; }
    126126        }
    127127
     
    149149
    150150        #region Basic P2P Methods (Init, Start, Stop) - synch and asynch
     151
     152        public void Initialize(P2PSettings p2pSettings)
     153        {
     154            Initialize(p2pSettings.PeerName, p2pSettings.WorldName,
     155                (P2PLinkManagerType)p2pSettings.LinkManagerType, (P2PBootstrapperType)p2pSettings.BSType,
     156                (P2POverlayType)p2pSettings.OverlayType, (P2PDHTType)p2pSettings.DhtType);
     157        }
    151158
    152159        /// <summary>
     
    350357                 * ATTENTION: This could change the invocation order!!! In my case
    351358                              no problem, but maybe in future cases... */
    352                 OnP2PMessageReceived.BeginInvoke(pid, e.Message.Data.PopBytes(e.Message.Data.CurrentStackSize),null,null);
     359                OnP2PMessageReceived.BeginInvoke(pid, e.Message.Data.PopBytes(e.Message.Data.CurrentStackSize), null, null);
    353360                //OnP2PMessageReceived(pid, e.Message.Data.PopUTF8String());
    354361            }
     
    420427                    OnDhtStore_Completed(false);
    421428            }
    422                
     429
    423430        }
    424431
     
    437444            if (OnDhtRemove_Completed != null)
    438445            {
    439                 if(rr.Status == OperationStatus.Success)
     446                if (rr.Status == OperationStatus.Success)
    440447                    OnDhtRemove_Completed(true);
    441448                else
     
    463470            Guid g = this.dht.Store(OnSynchStoreCompleted, sKey, byteData);
    464471
    465             ResponseWait rw = new ResponseWait() { WaitHandle = are, key=sKey , value = byteData };
     472            ResponseWait rw = new ResponseWait() { WaitHandle = are, key = sKey, value = byteData };
    466473
    467474            waitDict.Add(g, rw);
     
    565572
    566573            LogToMonitor("Begin: SynchRetrieve. Key: " + sKey);
    567              
     574
    568575            Guid g = this.dht.Retrieve(OnSynchRetrieveCompleted, sKey);
    569            
    570             ResponseWait rw = new ResponseWait() {WaitHandle = are };
    571            
    572             waitDict.Add(g,rw  );
     576
     577            ResponseWait rw = new ResponseWait() { WaitHandle = are };
     578
     579            waitDict.Add(g, rw);
    573580            // blocking till response
    574581            are.WaitOne();
     
    587594        {
    588595            LogToMonitor(rr.Guid.ToString());
    589            
     596
    590597            ResponseWait rw;
    591598
     
    675682        public void LogToMonitor(string sTextToLog)
    676683        {
    677             if(AllowLoggingToMonitor)
     684            if (AllowLoggingToMonitor)
    678685                Log.Debug(sTextToLog);
    679686        }
Note: See TracChangeset for help on using the changeset viewer.