private void DealOpcReWritDate()
{
try
{
while (true)
{
lock (OpcReWriteQueue)
{
while (OpcReWriteQueue.Count > 0)
{
try
{
OpcReWrite q = OpcReWriteQueue.Peek();
DicOpcSer[q.OpcServerName].WriteByType(q.groupID + q.itemType, (int)q.value, q.itemIndex);
OpcReWriteQueue.Dequeue();
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
}
Thread.Sleep(1000);
}
}
catch (Exception ex)
{
LOG.Error(ex.Message);
}
}
当DicOpcSer[q.OpcServerName].WriteByType(q.groupID + q.itemType, (int)q.value, q.itemIndex);出错时线程不再执行。不知道什么原因。线程
{
try
{
while (true)
{
lock (OpcReWriteQueue)
{
while (OpcReWriteQueue.Count > 0)
{
try
{
OpcReWrite q = OpcReWriteQueue.Peek();
DicOpcSer[q.OpcServerName].WriteByType(q.groupID + q.itemType, (int)q.value, q.itemIndex);
OpcReWriteQueue.Dequeue();
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
}
Thread.Sleep(1000);
}
}
catch (Exception ex)
{
LOG.Error(ex.Message);
}
}
当DicOpcSer[q.OpcServerName].WriteByType(q.groupID + q.itemType, (int)q.value, q.itemIndex);出错时线程不再执行。不知道什么原因。线程
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货