tiesky.com.SharmIpcInternals.ReaderWriterHandler.Dispose C# (CSharp) Method

Dispose() public method

MsgId of the sender and payload
public Dispose ( ) : void
return void
        public void Dispose()
        {
            try
            {
                if (ewh_Writer_ReadyToRead != null)
                {
                    //ewh_Writer_ReadyToRead.Set();
                    ewh_Writer_ReadyToRead.Close();
                    ewh_Writer_ReadyToRead.Dispose();
                    ewh_Writer_ReadyToRead = null;
                }
            }
            catch
            {
            }
            try
            {
                if (ewh_Writer_ReadyToWrite != null)
                {
                    //ewh_Writer_ReadyToWrite.Set();
                    ewh_Writer_ReadyToWrite.Close();
                    ewh_Writer_ReadyToWrite.Dispose();
                    ewh_Writer_ReadyToWrite = null;
                }
            }
            catch
            {
            }

            try
            {
                if (ewh_Reader_ReadyToRead != null)
                {
                    //ewh_Reader_ReadyToRead.Set();
                    ewh_Reader_ReadyToRead.Close();
                    ewh_Reader_ReadyToRead.Dispose();
                    ewh_Reader_ReadyToRead = null;
                }
            }
            catch
            {
            }
            try
            {
                if (ewh_Reader_ReadyToWrite != null)
                {
                    //ewh_Reader_ReadyToWrite.Set();
                    ewh_Reader_ReadyToWrite.Close();
                    ewh_Reader_ReadyToWrite.Dispose();
                    ewh_Reader_ReadyToWrite = null;
                }
            }
            catch
            {}

            try
            {
                if (Writer_accessor != null)
                {
                    Writer_accessor.SafeMemoryMappedViewHandle.ReleasePointer();
                    Writer_accessor.Dispose();
                    Writer_accessor = null;
                }
            }
            catch
            {}
            try
            {
                if (Reader_accessor != null)
                {
                    Reader_accessor.SafeMemoryMappedViewHandle.ReleasePointer();
                    Reader_accessor.Dispose();
                    Reader_accessor = null;
                }
            }
            catch
            { }
            try
            {
                if (Writer_mmf != null)
                {
                    Writer_mmf.Dispose();
                    Writer_mmf = null;
                }
            }
            catch
            { }
            try
            {
                if (Reader_mmf != null)
                {
                    Reader_mmf.Dispose();
                    Reader_mmf = null;
                }
            }
            catch
            { }
        }

Usage Example

コード例 #1
0
        /// <summary>
        /// Disposing
        /// </summary>
        public void Dispose()
        {
            //this.SharmIPC.LogException("dispose test", new Exception("p7"));
            try
            {
                if (mt != null)
                {
                    mt.ReleaseMutex();
                    mt.Close();
                    mt.Dispose();
                    mt = null;
                }
            }
            catch {
            }

            //this.SharmIPC.LogException("dispose test", new Exception("p6"));

            if (rwh != null)
            {
                rwh.Dispose();
                rwh = null;
            }

            //this.SharmIPC.LogException("dispose test", new Exception("p7"));
        }
All Usage Examples Of tiesky.com.SharmIpcInternals.ReaderWriterHandler::Dispose