Changeset 1587


Ignore:
Timestamp:
Jun 4, 2010, 4:33:13 PM (12 years ago)
Author:
Paul Lelgemann
Message:

+ CrypP2P: Added configuration option for "Use local local address detection" (defaults to false)
o Minor bugfixes in PeerToPeer(Publisher|Subscriber), which seem to handle an unconnected p2p network wrong

Location:
trunk
Files:
9 edited

Legend:

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

    r1585 r1587  
    111111                    settings.LoadDefaults();
    112112                    settings.ConnectInternal = true;
    113                     settings.LocalReceivingPort = P2PSettings.Default.LocalPort;
    114                     settings.UseLocalAddressDetection = true;
     113                    settings.LocalReceivingPort = P2PSettings.Default.LocalReceivingPort;
     114                    settings.UseLocalAddressDetection = P2PSettings.Default.UseLocalAddressDetection;
    115115                    settings.AutoReconnect = false;
    116116                    settings.NoDelay = false;
  • trunk/CrypP2P/P2PSettings.Designer.cs

    r1579 r1587  
    135135        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    136136        [global::System.Configuration.DefaultSettingValueAttribute("0")]
    137         public int LocalPort {
     137        public int LocalReceivingPort {
    138138            get {
    139                 return ((int)(this["LocalPort"]));
     139                return ((int)(this["LocalReceivingPort"]));
    140140            }
    141141            set {
    142                 this["LocalPort"] = value;
     142                this["LocalReceivingPort"] = value;
    143143            }
    144144        }
     
    155155            }
    156156        }
     157       
     158        [global::System.Configuration.UserScopedSettingAttribute()]
     159        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     160        [global::System.Configuration.DefaultSettingValueAttribute("False")]
     161        public bool UseLocalAddressDetection {
     162            get {
     163                return ((bool)(this["UseLocalAddressDetection"]));
     164            }
     165            set {
     166                this["UseLocalAddressDetection"] = value;
     167            }
     168        }
    157169    }
    158170}
  • trunk/CrypP2P/P2PSettings.settings

    r1579 r1587  
    3030      <Value Profile="(Default)" />
    3131    </Setting>
    32     <Setting Name="LocalPort" Type="System.Int32" Scope="User">
     32    <Setting Name="LocalReceivingPort" Type="System.Int32" Scope="User">
    3333      <Value Profile="(Default)">0</Value>
    3434    </Setting>
     
    3636      <Value Profile="(Default)">10</Value>
    3737    </Setting>
     38    <Setting Name="UseLocalAddressDetection" Type="System.Boolean" Scope="User">
     39      <Value Profile="(Default)">False</Value>
     40    </Setting>
    3841  </Settings>
    3942</SettingsFile>
  • trunk/CrypP2P/app.config

    r1579 r1587  
    3535                <value />
    3636            </setting>
    37             <setting name="LocalPort" serializeAs="String">
     37            <setting name="LocalReceivingPort" serializeAs="String">
    3838                <value>0</value>
    3939            </setting>
     
    4141                <value>10</value>
    4242            </setting>
     43            <setting name="UseLocalAddressDetection" serializeAs="String">
     44                <value>False</value>
     45            </setting>
    4346        </Cryptool.P2P.P2PSettings>
    4447    </userSettings>
  • trunk/CrypPlugins/P2PEditor/P2PEditorSettings.cs

    r1579 r1587  
    216216        public int LocalPort
    217217        {
    218             get { return _settings.LocalPort; }
    219             set
    220             {
    221                 if (value != _settings.LocalPort)
    222                 {
    223                     _settings.LocalPort = value;
     218            get { return _settings.LocalReceivingPort; }
     219            set
     220            {
     221                if (value != _settings.LocalReceivingPort)
     222                {
     223                    _settings.LocalReceivingPort = value;
    224224                    OnPropertyChanged("LocalPort");
    225225                    HasChanges = true;
     
    228228        }
    229229
    230         [TaskPane("log2monitor_caption", "log2monitor_tooltip", GroupExpert, 5, false, DisplayLevel.Expert,
     230        [TaskPane("useLocalAddressDetection_caption", "useLocalAddressDetection_tooltip", GroupExpert, 5, false, DisplayLevel.Expert,
     231            ControlType.CheckBox)]
     232        public bool UseLocalAddressDetection
     233        {
     234            get { return _settings.UseLocalAddressDetection; }
     235            set
     236            {
     237                if (value != _settings.UseLocalAddressDetection)
     238                {
     239                    _settings.UseLocalAddressDetection = value;
     240                    OnPropertyChanged("UseLocalAddressDetection");
     241                    HasChanges = true;
     242                }
     243            }
     244        }
     245
     246        [TaskPane("log2monitor_caption", "log2monitor_tooltip", GroupExpert, 6, false, DisplayLevel.Expert,
    231247            ControlType.CheckBox)]
    232248        public bool Log2Monitor
  • trunk/CrypPlugins/P2PEditor/Resources/Attributes.Designer.cs

    r1579 r1587  
    161161       
    162162        /// <summary>
    163         ///   Looks up a localized string similar to Local port used by the framework. If set to 0, the framework will choose a random port..
     163        ///   Looks up a localized string similar to Local port used by the framework. If set to 0, the framework will choose a random port. To use a value other than 0, &quot;Use local port address detection&quot; must be set to true..
    164164        /// </summary>
    165165        internal static string localPort_tooltip {
     
    247247            get {
    248248                return ResourceManager.GetString("stop_tooltip", resourceCulture);
     249            }
     250        }
     251       
     252        /// <summary>
     253        ///   Looks up a localized string similar to Use local port address detection.
     254        /// </summary>
     255        internal static string useLocalAddressDetection_caption {
     256            get {
     257                return ResourceManager.GetString("useLocalAddressDetection_caption", resourceCulture);
     258            }
     259        }
     260       
     261        /// <summary>
     262        ///   Looks up a localized string similar to Setting for nodes, where the internal and external adresses match. Setting &quot;Local port&quot; currently only works, when this is set to true..
     263        /// </summary>
     264        internal static string useLocalAddressDetection_tooltip {
     265            get {
     266                return ResourceManager.GetString("useLocalAddressDetection_tooltip", resourceCulture);
    249267            }
    250268        }
  • trunk/CrypPlugins/P2PEditor/Resources/Attributes.resx

    r1579 r1587  
    152152  </data>
    153153  <data name="localPort_tooltip" xml:space="preserve">
    154     <value>Local port used by the framework. If set to 0, the framework will choose a random port.</value>
     154    <value>Local port used by the framework. If set to 0, the framework will choose a random port. To use a value other than 0, "Use local port address detection" must be set to true.</value>
    155155  </data>
    156156  <data name="log2monitor_caption" xml:space="preserve">
     
    181181    <value>Disconnect from P2P network. For debugging only.</value>
    182182  </data>
     183  <data name="useLocalAddressDetection_caption" xml:space="preserve">
     184    <value>Use local port address detection</value>
     185  </data>
     186  <data name="useLocalAddressDetection_tooltip" xml:space="preserve">
     187    <value>Setting for nodes, where the internal and external adresses match. Setting "Local port" currently only works, when this is set to true.</value>
     188  </data>
    183189  <data name="username_caption" xml:space="preserve">
    184190    <value>Username</value>
  • trunk/CrypPlugins/PeerToPeerPublisher/P2PPublisherBase.cs

    r1433 r1587  
    181181                    return;
    182182                }
     183            } else
     184            {
     185                GuiLogging("byRead not available. Aborting.", NotificationLevel.Error);
     186                return;
    183187            }
    184188            /* END: CHECKING WHETHER THERE HAS ALREADY EXIST ANOTHER PUBLISHER */
  • trunk/CrypPlugins/PeerToPeerSubscriber/P2PSubscriberBase.cs

    r1433 r1587  
    145145                string sNonrelevant;
    146146                PeerId myPeerId = this.p2pControl.GetPeerID(out sNonrelevant);
    147                 GuiLogging("Started Subscriber with ID: '" + myPeerId.ToString() + "'", NotificationLevel.Info);
     147
     148                if (myPeerId != null)
     149                {
     150                    GuiLogging("Started Subscriber with ID: '" + myPeerId.ToString() + "'", NotificationLevel.Info);
     151                } else
     152                {
     153                    GuiLogging("myPeerId not available. Aborting.", NotificationLevel.Error);
     154                    return;
     155                }
    148156            }
    149157
Note: See TracChangeset for help on using the changeset viewer.