Ejemplo n.º 1
0
 public void Handle(ISerialPacket packet)
 {
     lock (syncRoot)
     {
         if (State == InstructionState.Emit)
         {
             try
             {
                 DoHandle(packet);
             }
             catch (Exception ex)
             {
                 Log.Error(string.Format("{0} - {1}", ErrorCode.InstructionHandleError, Name), ex);
             }
             finally
             {
                 timing.Stop();
                 var waitTime = Delay - timing.ElapsedMilliseconds;
                 if (waitTime > 0)
                 {
                     Thread.Sleep(TimeSpan.FromMilliseconds(waitTime));
                 }
                 Monitor.Pulse(syncRoot);
             }
         }
     }
 }
Ejemplo n.º 2
0
 public void Handle(ISerialPacket packet)
 {
     lock (syncRoot)
     {
         if (State == InstructionState.Emit)
         {
             try
             {
                 DoHandle(packet);
             }
             catch (Exception ex)
             {
                 Log.Error(string.Format("{0} - {1}", ErrorCode.InstructionHandleError, Name), ex);
             }
             finally
             {
                 timing.Stop();
                 var waitTime = Delay - timing.ElapsedMilliseconds;
                 if (waitTime > 0) Thread.Sleep(TimeSpan.FromMilliseconds(waitTime));
                 Monitor.Pulse(syncRoot);
             }
         }
     }
 }
Ejemplo n.º 3
0
 protected override void DoHandle(ISerialPacket packet)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 4
0
 protected override void DoHandle(ISerialPacket packet)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 5
0
 protected abstract void DoHandle(ISerialPacket packet);
Ejemplo n.º 6
0
 protected abstract void DoHandle(ISerialPacket packet);