Example #1
0
        public void Close()
        {
            if (!fd.HasValue)
            {
                throw new Exception();
            }

            cts.Cancel();
            Libc.close(fd.Value);
            Marshal.FreeHGlobal(readingBuffer);
        }
Example #2
0
        /// <summary>
        /// Close the port
        /// </summary>
        public void Close()
        {
            if (!_FileDescriptor.HasValue)
            {
                throw new Exception();
            }

            cts.Cancel();
            Libc.close(_FileDescriptor.Value);
            Marshal.FreeHGlobal(_ReadingBuffer);
            _FileDescriptor = null;
        }