Changeset 2741


Ignore:
Timestamp:
Feb 19, 2011, 9:42:41 AM (11 years ago)
Author:
Sven Rech
Message:

another small distributed key searcher fix

Location:
trunk/CrypPlugins/KeySearcher
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/KeySearcher/P2P/DistributedBruteForceManager.cs

    r2740 r2741  
    215215                                status.CurrentOperation = Resources.Connection_lost__Waiting_for_reconnection_to_store_the_results_;
    216216                                keySearcher.GuiLogMessage(status.CurrentOperation, NotificationLevel.Info);
    217                                 do
    218                                 {
    219                                     P2PManager.P2PBase.OnSystemJoined += P2PBase_OnSystemJoined;
    220                                     systemJoinEvent.WaitOne(1000);
    221                                 } while (!P2PManager.IsConnected);
     217                                WaitForReconnect();
    222218                            }
    223219                            status.CurrentOperation = Resources.Processing_results_of_calculation;
     
    283279                catch (NotConnectedException)
    284280                {
    285                     status.CurrentOperation = "Connection lost. Waiting for reconnect...";
     281                    status.CurrentOperation = Resources.Connection_lost__Waiting_for_reconnect___;
    286282                    keySearcher.GuiLogMessage(status.CurrentOperation, NotificationLevel.Info);
    287                     do
    288                     {
    289                         P2PManager.P2PBase.OnSystemJoined += P2PBase_OnSystemJoined;
    290                         systemJoinEvent.WaitOne(1000);
    291                     } while (!P2PManager.IsConnected && !keySearcher.stop);
     283                    WaitForReconnect();
    292284                }
    293285                catch (InvalidOperationException)
     
    315307        }
    316308
     309        private void WaitForReconnect()
     310        {
     311            do
     312            {
     313                P2PManager.P2PBase.OnSystemJoined += P2PBase_OnSystemJoined;
     314                systemJoinEvent.WaitOne(1000);
     315                P2PManager.P2PBase.OnSystemJoined -= P2PBase_OnSystemJoined;
     316            } while (!P2PManager.IsConnected && !keySearcher.stop);
     317        }
     318
    317319        private int FindLocalPatterns()
    318320        {
     
    362364        void P2PBase_OnSystemJoined()
    363365        {
    364             P2PManager.P2PBase.OnSystemJoined -= P2PBase_OnSystemJoined;
    365366            systemJoinEvent.Set();
    366367        }
  • trunk/CrypPlugins/KeySearcher/Properties/Resources.Designer.cs

    r2720 r2741  
    305305       
    306306        /// <summary>
     307        ///   Looks up a localized string similar to Connection lost. Waiting for reconnect....
     308        /// </summary>
     309        internal static string Connection_lost__Waiting_for_reconnect___ {
     310            get {
     311                return ResourceManager.GetString("Connection_lost__Waiting_for_reconnect___", resourceCulture);
     312            }
     313        }
     314       
     315        /// <summary>
    307316        ///   Looks up a localized string similar to Connection lost! Waiting for reconnection to store the results!.
    308317        /// </summary>
  • trunk/CrypPlugins/KeySearcher/Properties/Resources.resx

    r2720 r2741  
    646646                <value xml:space="preserve">{0:0,0} key/sec</value>
    647647        </data>
     648        <data name="Connection_lost__Waiting_for_reconnect___">
     649                <value xml:space="preserve">Connection lost. Waiting for reconnect...</value>
     650        </data>
    648651</root>
Note: See TracChangeset for help on using the changeset viewer.