コード例 #1
0
 protected void OnSendException(SBPSendExceptionEventArgs e)
 {
     if (SendExeceptionEvent != null)
     {
         SendExeceptionEvent.Invoke(this, e);
     }
 }
コード例 #2
0
        private void InvokeThread()
        {
            SBPSendExceptionEventArgs sendException = null;
            SBPReadExceptionEventArgs readException = null;

            while (!_invokeThreadStop)
            {
                if (_sendExceptionQueue.Count > 0)
                {
                    lock (_syncobject)
                        sendException = _sendExceptionQueue.Dequeue();
                }

                if (_readExceptionQueue.Count > 0)
                {
                    lock (_syncobject)
                        readException = _readExceptionQueue.Dequeue();
                }

                if (sendException != null)
                {
                    OnSendException(sendException);
                    sendException = null;
                }
                if (readException != null)
                {
                    OnReadException(readException);
                    readException = null;
                }
                if (!InvokeThreadExecute() && readException == null && sendException == null)
                {
                    Thread.Sleep(1);
                }
            }
        }