Download binaries & source. Please ask permission before using commerically.
An easy-to-use, zero configuration solution to .Net communication across application boundaries. A simple library to use as an alternative to .Net Remoting based on low-level Windows Messaging.
The XDMessaging library provides an easy-to-use, zero configuration
solution to same-box cross AppDomain communications. It provides a simple API for
sending and receiving targeted string messages across application boundaries.
The library allows the use of user-defined pseudo 'channels' through which messages may be sent and received. Any application can send a message to any channel, but it must register as a listener with the channel in order to receive. In this way developers can quickly and programmatically devise how their applications will communicate with each other best to work in harmony.
Update: See Version 2.0 of the library which now includes support for Windows Services.
Examples
Example: Sending a message.
// Send shutdown message a channel named commands
XDBroadcast.SendToChannel("commands", "shutdown");
Example: Listening on a channel.
// Create our listener instance
XDListener listener = new XDListener();
// Register channels to listen on
listener.RegisterChannel("events");
listener.RegisterChannel("status");
listener.RegisterChannel("commands");
// Stop listening on a specific channel
listener.UnRegisterChannel("status");
Example: Handling the messages.
// Attach an event handler to our instance
listener.MessageReceived+=XDMessageHandler(this.listener_MessageReceived);
// process the message
private void listener_MessageReceived(object sender, XDMessageEventArgs e)
{
// e.DataGram.Message is the message
// e.DataGram.Channel is the channel name
switch(e.DataGram.Message)
{
case "shutdown":
this.Close();
break;
}
}
The Messenger demo
A simple demo is included in the download to demonstrate the use of the library.
To see the demo you will need to launch multiple instances of the Messenger.exe
application. The demo application severs no practical purpose other than to demonstrate
the use of the XDMessaging library. It shows how messages may be passed to multiple
instances of a desktop application across application boundaries.
The application uses 2 arbitrary channels named Status and UserMessage. Window events
such as onClosing and onLoad are broadcast as messages
on the Status channel (displayed in green), and user messages are broadcast on the
UserMessage channel (displayed in blue). By checking or unchecking the options you
may toggle which channel messages the window will listen for.
See here for further information.
Senior software engineer with over 10 years experience in a wide range of technologies.