Esempio n. 1
0
        //send job to worker
        public bool SendJob(SharedSerialization.Job job)
        {
            try
            {
                if (!gpu.Enabled || IsTerminated)
                {
                    return(true);
                }

                if (stream != null)
                {
                    lock (stream)
                    {
                        (new BinaryFormatter()
                        {
                            AssemblyFormat = System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Simple
                        }).Serialize(stream, job);
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                Logger.Log(ex);
                return(false);
            }
        }
Esempio n. 2
0
 //new job received from stratum connection
 public static void newJobReceived(SharedSerialization.Job job)
 {
     lock (lockPush)
     {
         lastJob = DateTime.Now;
         //update workers..
         foreach (var worker in workers)
         {
             worker.SendJob(job);
         }
     }
 }