Esempio n. 1
0
        protected override bool HandleErrorSituation(string msg, bool isWrite)
        {
            if (Marshal.GetLastWin32Error() == Native.ERROR_OPERATION_ABORTED)
            {
                Native.COMSTAT cs = new Native.COMSTAT(); cs.Initialize();
                uint           errors;

                Native.ClearCommError(m_handle.DangerousGetHandle(), out errors, ref cs);

                return(true);
            }

            return(base.HandleErrorSituation(msg, isWrite));
        }
Esempio n. 2
0
        protected override bool HandleErrorSituation( string msg, bool isWrite )
        {
            if(Marshal.GetLastWin32Error() == Native.ERROR_OPERATION_ABORTED)
            {
                Native.COMSTAT cs = new Native.COMSTAT(); cs.Initialize();
                uint           errors;

                Native.ClearCommError( m_handle.DangerousGetHandle(), out errors, ref cs );

                return true;
            }

            return base.HandleErrorSituation( msg, isWrite );
        }