24 lines
597 B
C#
24 lines
597 B
C#
using System;
|
|
using System.IO.MemoryMappedFiles;
|
|
|
|
namespace PdConnection
|
|
{
|
|
public class PdBuffer : IDisposable
|
|
{
|
|
private readonly MemoryMappedFile memoryMappedFile_;
|
|
private readonly MemoryMappedViewAccessor viewAccessor_;
|
|
|
|
public PdBuffer()
|
|
{
|
|
memoryMappedFile_ = MemoryMappedFile.OpenExisting("shared_memory");
|
|
viewAccessor_ = memoryMappedFile_.CreateViewAccessor();
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
viewAccessor_?.Dispose();
|
|
memoryMappedFile_?.Dispose();
|
|
}
|
|
}
|
|
|
|
}
|