Ignore:
Timestamp:
Dec 16, 2010, 8:12:05 PM (11 years ago)
Author:
Sven Rech
Message:

keysearcher

File:
1 edited

Legend:

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

    r2202 r2214  
    247247        private EndPoint externalClientConnected;
    248248        private AutoResetEvent waitForExternalClientToFinish = new AutoResetEvent(false);
     249        private DateTime assignTime;
    249250        #endregion
    250251
     
    760761                    externalClientConnected = null;
    761762                    cryptoolServer.Port = settings.Port;
    762                     cryptoolServer.OnJobCompleted += new CryptoolServer.JobCompletedDelegate(server_OnJobCompleted);
    763                     cryptoolServer.OnClientConnected += new CryptoolServer.ClientConnectedDelegate(server_OnClientConnected);
    764                     cryptoolServer.OnClientDisconnected += new CryptoolServer.ClientDisconnectedDelegate(cryptoolServer_OnClientDisconnected);
     763                    cryptoolServer.OnJobCompleted += server_OnJobCompleted;
     764                    cryptoolServer.OnClientConnected += server_OnClientConnected;
     765                    cryptoolServer.OnClientDisconnected += cryptoolServer_OnClientDisconnected;
    765766                    serverThread = new Thread(new ThreadStart(delegate
    766767                                                                      {
     
    783784                {
    784785                    //stop server here!
     786                    serverThread.Interrupt();
     787                    cryptoolServer.OnJobCompleted -= server_OnJobCompleted;
     788                    cryptoolServer.OnClientConnected -= server_OnClientConnected;
     789                    cryptoolServer.OnClientDisconnected -= cryptoolServer_OnClientDisconnected;
    785790                }
    786791            }
     
    10291034            j.Size = externalKeyTranslator.GetOpenCLBatchSize();
    10301035            j.ResultSize = 10;
     1036            GuiLogMessage(string.Format("Assigning new job with Guid {0} to client!", j.Guid), NotificationLevel.Info);
    10311037            cryptoolServer.SendJob(j, client);
     1038            assignTime = DateTime.Now;
    10321039        }
    10331040
    10341041        void server_OnJobCompleted(System.Net.EndPoint client, JobResult jr)
    10351042        {
     1043            GuiLogMessage(string.Format("Client returned result of job with Guid {0}!", jr.Guid), NotificationLevel.Info);
    10361044            //check:
    10371045            var op = this.costMaster.getRelationOperator();
     
    10511059
    10521060            //progress:
    1053             externalKeysProcessed += externalKeyTranslator.GetProgress();
    1054             showProgress(costList, pattern.size(), externalKeysProcessed, 1);
     1061            externalKeyTranslator.NextOpenCLBatch();
     1062            int progress = externalKeyTranslator.GetProgress();
     1063            externalKeysProcessed += progress;
     1064            int keysPerSec = (int)(progress / (DateTime.Now - assignTime).TotalSeconds);
     1065            showProgress(costList, pattern.size(), externalKeysProcessed, keysPerSec);
    10551066
    10561067            if (externalKeysProcessed != pattern.size())
Note: See TracChangeset for help on using the changeset viewer.