Skip to content

Fast mechanism for sending messages using memory-mapped files

License

Notifications You must be signed in to change notification settings

praful-hunde/MemoryMessagePipe

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MemoryMessagePipe

Allows for communication between two processes using memory-mapped files.

Sending a message:

using (var sender = new MemoryMappedFileMessageSender("foo"))
{
    sender.SendMessage(stream => serializer.Serialize(stream, new Foo {Bar = "foobar"}));
}

Receiving a message:

using (var receiver = new MemoryMappedFileMessageReceiver("foo"))
{
    var message = receiver.ReceiveMessage(stream => serializer.Deserialize<Foo>(stream));
}

There should be exactly one sender and exactly one receiver per file. Communication is uni-directional. Use two files for bi-directional communication. Multiple messages can be sent/received, but the sender will wait until the receiver has received a message before sending subsequent messages.

About

Fast mechanism for sending messages using memory-mapped files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%