Ignore:
Timestamp:
May 21, 2010, 4:00:55 PM (12 years ago)
Author:
Paul Lelgemann
Message:
  • Removed unused references and using statement in CrypP2P, PeerToPeer, PeerToPeerBaseProxy

+ Skeleton for P2PEditor

File:
1 edited

Legend:

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

    r1433 r1458  
    11using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    42using System.Text;
    5 using Cryptool.PluginBase.Control;
    63using Cryptool.PluginBase.IO;
    74
     
    3936            PeerId pid = null;
    4037            byte[] byteLoad = p2pControl.DHTload(sTopicName);
    41             if(byteLoad != null)
     38            if (byteLoad != null)
    4239                pid = p2pControl.GetPeerID(byteLoad);
    4340            return pid;
     
    5148        /// <param name="aliveMessageInterval">AliveMessageInterval in milliseconds</param>
    5249        /// <returns>true, if storing value in the DHT was successfull.</returns>
    53         public static bool SetAliveMessageInterval(ref IP2PControl p2pControl, string sTopicName, long aliveMessageInterval)
    54         {
    55             return p2pControl.DHTstore(sTopicName + AliveMsg, System.BitConverter.GetBytes(aliveMessageInterval));
     50        public static bool SetAliveMessageInterval(ref IP2PControl p2pControl, string sTopicName,
     51                                                   long aliveMessageInterval)
     52        {
     53            return p2pControl.DHTstore(sTopicName + AliveMsg, BitConverter.GetBytes(aliveMessageInterval));
    5654        }
    5755
     
    6967            byte[] byteLoad = p2pControl.DHTload(sTopicName + AliveMsg);
    7068            if (byteLoad != null)
    71                 ret = System.BitConverter.ToInt64(byteLoad, 0);
     69                ret = BitConverter.ToInt64(byteLoad, 0);
    7270            return ret;
    7371        }
     
    8684            if (cStream != null && sTopicName != null && sTopicName != String.Empty && p2pControl != null)
    8785            {
    88                 CryptoolStream newEncryptedData = new CryptoolStream();
     86                var newEncryptedData = new CryptoolStream();
    8987                newEncryptedData.OpenRead(cStream.FileName);
    9088                if (newEncryptedData.CanRead)
     
    9290                    // Convert CryptoolStream to an byte Array and store it in the DHT
    9391                    if (newEncryptedData.Length > Int32.MaxValue)
    94                         throw (new Exception("Encrypted Data are too long for this PlugIn. The maximum size of Data is " + Int32.MaxValue + "!"));
    95                     byte[] byteEncryptedData = new byte[newEncryptedData.Length];
     92                        throw (new Exception(
     93                            "Encrypted Data are too long for this PlugIn. The maximum size of Data is " + Int32.MaxValue +
     94                            "!"));
     95                    var byteEncryptedData = new byte[newEncryptedData.Length];
    9696                    int k = newEncryptedData.Read(byteEncryptedData, 0, byteEncryptedData.Length);
    9797                    if (k < byteEncryptedData.Length)
     
    177177
    178178        // new stuff - Arnie 2010.02.02
    179        
     179
    180180        ///// <summary>
    181181        ///// Sets or updates the TimeStamp for the actual Publisher
     
    217217    }
    218218}
    219 
Note: See TracChangeset for help on using the changeset viewer.