Files
SharedMemoryExample/ReaderApp/Program.cs
T

16 lines
412 B
C#
Raw Normal View History

2026-11-19 09:50:21 +01:00
2026-11-18 11:20:38 +01:00
try
{
2026-11-19 10:16:51 +01:00
using var consumer = new WriterApp.SharedBuffer<int>("MySharedBuffer");
consumer.BufferAction((span) =>
{
for (var i = 0; i < span.Length; i++)
{
Console.WriteLine($"Read {span[i]} from the shared buffer");
}
});
2026-11-18 11:20:38 +01:00
}
catch (FileNotFoundException)
{
Console.WriteLine("No process has MySharedArray open. Start the first program before this one.");
}