Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1260 for trunk


Ignore:
Timestamp:
03/05/09 17:55:17 (16 years ago)
Author:
kgrading
Message:

updates and extension of the implementation (#493)

Location:
trunk/sources/HeuristicLab.Hive.Client.Core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs

    r1255 r1260  
    253253    void wcfService_Connected(object sender, EventArgs e) {
    254254      wcfService.LoginSync(ConfigManager.Instance.GetClientInfo());
     255      JobStorrageManager.CheckAndSubmitJobsFromDisc();
    255256    }
    256257
  • trunk/sources/HeuristicLab.Hive.Client.Core/JobStorrage/JobStorrageManager.cs

    r1219 r1260  
    44using System.Text;
    55using System.IO;
     6using HeuristicLab.Hive.Client.Common;
     7using HeuristicLab.Hive.Client.Communication;
    68
    79namespace HeuristicLab.Hive.Client.Core.JobStorrage {
     
    1012   
    1113    public static void PersistObjectToDisc(String serverIP, long serverPort, long jobId, byte[] job) {
    12       String filename = serverIP + serverPort + jobId.ToString();
     14      String filename = serverIP + "." + serverPort + "." + jobId.ToString();
    1315     
    1416      JobStorrageInfo info = new JobStorrageInfo { JobID = jobId, ServerIP = serverIP, ServerPort = serverPort, TimeFinished = DateTime.Now };
    1517      try {
    16         Stream jobstream = File.Create("jobStorrage\\"+filename + ".dat");
     18        Stream jobstream = File.Create("C:\\Program Files\\HeuristicLab 3.0\\plugins\\jobStorrage\\ "+filename + ".dat");
    1719        jobstream.Write(job, 0, job.Length);
    1820        StoredJobsList.Add(info);
    1921        jobstream.Close();
     22        Logging.GetInstance().Info("JobStorrageManager", "Job " + info.JobID + " stored on the harddisc");
    2023      }
    2124      catch (Exception e) {
     
    2326      }       
    2427    }
     28
     29    public static void CheckAndSubmitJobsFromDisc() {
     30      foreach (JobStorrageInfo info in StoredJobsList) {
     31        if (WcfService.Instance.ConnState == NetworkEnum.WcfConnState.Loggedin && (info.ServerIP == WcfService.Instance.ServerIP && info.ServerPort == WcfService.Instance.ServerPort)) {
     32          Logging.GetInstance().Info("JobStorrageManager", "Sending stored job " + info.JobID + " to the server");
     33        }
     34      }
     35    }
    2536  }
    2637}
Note: See TracChangeset for help on using the changeset viewer.