public void Close() { if (!fd.HasValue) { throw new Exception(); } cts.Cancel(); Libc.close(fd.Value); Marshal.FreeHGlobal(readingBuffer); }
/// <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; }