My Photo

Technical Architect with over 15 years experience in a wide range of technologies.

@TheCodeKing

rss feed

XDMessaging 4.0 | Friday, February 01, 2013

Introduction

The XDMessaging library provides an easy-to-use, zero configuration solution to inter-process communication for .NET applications. It provides a simple API for broadcasting and receiving messages across application domain, process, and even network 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.

The messages may optionally be propagated to other processes over a network automatically.

Installation

Install the library using Nuget.

PM> Install-Package XDMessaging

Advantages

The XDMessaging library offers some advantages over other IPC technologies like WCF, .Net Remoting, Sockets, NamedPipes and MailSlots. To begin with the library does not require a server-client relationship as there is no physical connection between processes.

With XDMessaging messages can be broadcast by multiple applications and instantly received by multiple listeners in a disconnected fashion. It's also worth noting that most of the existing IPC implementations require the opening of specific ports and somewhat painful configuration of settings to make work. With XDMessaging there is no configuration, the API determines where messages are sent, and which messages are received using pseudo channels.

Network Propagation

Network propagation is a feature of the library that allows messages to leverage HighPerformanceUI or Compatibility modes, whilst additionally distributing messages to a remote server. RemoteNetwork mode is used under the hood to transfer messages to disconnected servers, and messages are rebroadcast by a slave IXDListener instance using the original transport mode. If the slave instance terminates for any reason, then another listener instance will automatically take it’s place.

Using the Library

To use the library, create an instance of a IXDBroadcaster and use this to send a message to a named channel. You can then create an instance of IXDListener to receive messages on a particular channel. The channels are arbitrary strings chosen to represent a channel, and are not case sensitive. Before creating the broadcaster and listener instances you must first decide which transport mode you want to use for the library. There are 3 modes as follows and each has advantages over the other. Modes are abstracted from their specific implementations for extensibility, and loosely coupled. In order to use one of the modes the appropriate assembly must be referenced in the project in addition to XDMessaging.

Transport Modes

  • Compatibility: The default implementation uses file based IO to broadcast messages via a shared directory. A FileSystemWatcher is used within listener classes to monitor changes and trigger the MessageReceived event containing the broadcast message. This mode can be used in Windows Services, console applications, and Windows Forms based applications. Channels are created as separate directories on the file system for each channel. The temporary directories should be accessible by all processes, and there should be no need for manual configuration. To use this implementation add a reference to XDMessaging.Transport.IOStream in your project.
  • HighPerformanceUI: The default implementation uses the WM_COPYDATA Windows Message to copy data between applications. The broadcaster implementation sends the Windows Messages directly to a hidden window on the listener instance, which dispatches the MessageReceived event with the copied data. Channels are created by adding/removing Windows properties. This offers the most performant solution for Windows Forms based applications, but does not work for Windows Services, Console apps, or other applications without a message pump. To use this implementation add a reference to XDMessaging.Transport.WindowsMessaging in your project.
  • RemoteNetwork: By default this uses Amazon Web Services to implement a subscriber/publisher implementation for broadcasting messages over a network and interprocess. There may be associated costs involved in using this mode, and you will need to supply valid Amazon account credentials. This mode is used internally to send messages from other transport modes over the network when using network propagation mode. To use this implementation add a reference to XDMessaging.Transport.Amazon in your project.

Note: Messages broadcast using a particular mode can only be read by applications using a listener in the same mode. For example, Compatibility listeners cannot read messages broadcast in the HighPerformanceUI mode. It is possible to broadcast in several modes at the same time, see documentation for further details. See the included sample applications for more information on using the library in Windows Forms applications or within a Windows Service.

Messaging Demo

Download the source code and demo application from GitHub. Refer to user guide for more information.


55 comments:

Василий Боровяк said...

Hi. Do you plan to upload to NuGet the library compiled for .Net Framework 4.0?

TheCodeKing said...

Hi the version that's there works with .Net Framework 4.0. Are you having a specific issue?

jio said...

The messages not sending from Windows Service:

protected override void OnStart(string[] args)
{
IXDBroadcast ixdbBroadcast = XDBroadcast.CreateBroadcast(XDTransportMode.WindowsMessaging);

try
{
IPAddress localIPAdress = IPAddress.Parse(clsIni.Read_ini_settings("[SETTINGS]", "WSIP"));
int localPort = Convert.ToInt32(clsIni.Read_ini_settings("[SETTINGS]", "WSPort"));

asyncServer = new clsSocket.AsyncServer(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
asyncServer.Start(localIPAdress, localPort);

ixdbBroadcast.SendToChannel("gposWS", "Start");
clsSystemEvents.writeEvent("gpos.ge windows სერვისი ჩაიტვირთა1.", EventLogEntryType.Information, 1);
}
catch (Exception exc)
{
clsSystemEvents.writeEvent(exc.Message, EventLogEntryType.Error, 0);
}
}

TheCodeKing said...

WIndowsMessaging doesn't work from a Windows service as it can't access the desktop windows to send messages, use IOStream mode instead.

jio said...

Thank you for quick answer. I changed it and am able to communicate, but now I have another problem. When message arrives program calls IXDListener_MessageReceived event. in this event I try to change lblVersion text, but it gives error:

Cross-thread operation not valid: Control 'lblVersion' accessed from a thread other than the thread it was created on.

TheCodeKing said...

This occurs when trying to update the UI from a non-UI thread. The solution is to use BeginInvoke.

public void ChangeUITitle(string title)
{
if (this.InvokeRequired)
{
this.BeginInvoke(new Invoker(ChangeUITitle), title);
return;
}
this.Text = title;
}

jio said...

Thanks, it was useful for me.

jio said...

I had one more problem:
Don't now how to create serializable object, for sending via IOStream, from the class with properties:

private string ConnIdent;
private DateTime ConnDateTime;
private string ConnIP;
private int ConnPort;

Could you provide an example?

TheCodeKing said...

Hi all you need to do is add the [Serializable] attribute above the class decloration.

[Serializable]
public class MyClass
{
...
}

jio said...

I created class in the Windows Service and Windows form program:
[Serializable]
public class clsConnectionLogs
{
private string pConnIdent;
private DateTime pConnDateTime;
private string pConnIP;
private int pConnPort;
public string ConnIdent {
get { return pConnIdent; }
set { pConnIdent = value.Trim(); } }
public DateTime ConnDateTime {
get { return pConnDateTime; }
set { pConnDateTime = value; } }
public string ConnIP {
get { return pConnIP; }
set { pConnIP = value.Trim(); } }
public int ConnPort {
get { return pConnPort; }
set { pConnPort = value; } }
}

From windows service I sending like this:
IXDBroadcast ixdbBroadcast = XDBroadcast.CreateBroadcast(XDTransportMode.IOStream);

clsConnectionLogs objClsConnectionLogs = new clsConnectionLogs();

objClsConnectionLogs.ConnIdent = intClientCount.ToString();
objClsConnectionLogs.ConnDateTime = System.DateTime.Now;
objClsConnectionLogs.ConnIP = ((IPEndPoint)workerSocket.RemoteEndPoint).Address.ToString();
objClsConnectionLogs.ConnPort = ((IPEndPoint)workerSocket.RemoteEndPoint).Port;

ixdbBroadcast.SendToChannel("gposWS", objClsConnectionLogs);

in Windows Form application in IXDListener_MessageReceived event i wrote:
TypedDataGram typedMsg = e.DataGram;
if (typedMsg.IsValid == true)
customData = typedMsg.Message;

BUT every time i'm getting typedMsg.IsValid=false and typedMsg.Message=null

e.DataGram looks like:
{gposWS:AAEAAAD/////AQAAAAAAAAAMAgAAAEV3d3cuZ3Bvcy5nZV93cywgVmVyc2lvbj0yLjAuMi4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAACB3d3cuZ3Bvcy5nZV93cy5jbHNDb25uZWN0aW9uTG9ncwQAAAAKcENvbm5JZGVudA1wQ29ubkRhdGVUaW1lB3BDb25uSVAJcENvbm5Qb3J0AQABAA0IAgAAAAYDAAAAATGGeXKSbH7PiAYEAAAACTEyNy4wLjAuMaK4AAALAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==}

How can I declare seriazable class and sens via IOStream???

TheCodeKing said...

Hi, sorry for taking so long to get back to you. It looks like it can't deserialize the data into a type. Are you referencing the same version of clsConnectionLogs in both projects? They will need to be the same version.

jio said...

yes, the version ares same on both side. I solved this problem with sending xml type as a message. Then on other side I can read this xml and manage data. Anyway, Thank you.

tloomos said...

It's simply amazing how easy it is t implement this library and how it just works - Well Done!

II'm experiencing one minor problem that I'm hoping you can assist me with. I'm using the IO Stream mode and the subscribed message received event is firing twice for every message received.

I tried the test messenger application that was included in the download and I experienced the same behavior. It works as expected when the mode is Win Msg, but IO Stream consistently results in duplicate messages.

I also upgraded to the latest version from NuGet and still received the same results.

Can you help point me in the right direction regarding what I may be doing wrong?

Thanks!

Figmo X said...

CodeKing - first let me thank you for a well designed and useful lib. Second - I have a problem. I put a Listener.Dispose() call in my form_closing() event and I get an exception when my form closes...

System.Runtime.InteropServices.SEHException was unhandled
HResult=-2147467259
Message=External component has thrown an exception.
Source=mscorlib
ErrorCode=-2147467259
StackTrace:
Server stack trace:
at TheCodeKing.Net.Messaging.Concrete.MailSlot.Native.CloseHandle(IntPtr handle)
at TheCodeKing.Net.Messaging.Concrete.MailSlot.MailSlotReader.Listen(Action`1 callback)
at TheCodeKing.Net.Messaging.Concrete.MailSlot.MailSlotWatcher.b__0()
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
at System.Action.EndInvoke(IAsyncResult result)
at System.Runtime.Remoting.Messaging.AsyncResult.SyncProcessMessage(IMessage msg)
at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
at System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.ThreadPoolCallBack(Object o)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
InnerException:

TheCodeKing said...

Hi I've not seen that behaviour, what OS are you using? What version of .Net? Are you using Network propagation?

Figmo X said...

My OS is Win7 x64. .NET is 4.0

I am not specifically setting up any network propagation as I do not need this. Is there something I should do to DISABLE it (is it enabled by default)?

If I remove the Dispose() from my formclosing event and just let .NET cleanup my form using it's built in GC -- it all works fine.

So for right now - this is not holding me back because the life of the listener is the same as the life of the form for this app.

But if I ever need to use it in a situation where I need to Dispose() the listener explicitly this will become an issue.

TheCodeKing said...

The way it works is that every listener opts in by default to participate in network propagation. This is because of a limitation of MailSlots and to ensure all processes receive incoming network messages if they share the same mode.

If you don't care about not receiving messages from other boxes then you can opt out by passing true as an additional parameter when creating the listener. This will resolve your issue. It is correct to always call Dispose, and this looks like a bug.

The next version is a rewrite and removes MailSlots altogether in favour of AWS queues which has many advantages. Take a look at the develop branch on github. It's fully functional, I just need to fix an outstanding issue with queue clean up before I release it.

fastlink30 said...

Impossibile avviare il servizio. System.BadImageFormatException: Impossibile caricare il file o l'assembly 'aaclient.dll' o una delle relative dipendenze. Il modulo doveva contenere un manifesto di assembly.
Nome file: 'aaclient.dll' ---> System.BadImageFormatException: Impossibile caricare il file o l'assembly 'aaclient.dll' o una delle relative dipendenze. Il modulo doveva contenere un manifesto di assembly.
Nome file: 'aaclient.dll'


in System.Reflection.AssemblyName.nGetFileInformation(String s)
in System.Reflection.AssemblyName.GetAssemblyName(String assemblyFile)
in XDMessaging.IoC.SimpleIocScanner.<>c__DisplayClass7.b__5(Assembly x)
in System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
in XDMessaging.IoC.SimpleIocScanner.b__4(String a)
in System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
in System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
in System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
...

fastlink30 said...

Protected Overrides Sub OnStart(ByVal args() As String)
client = New XDMessaging.XDMessagingClient() <-- this make error
End Sub

TheCodeKing said...

Hi, can you email me some sample code to replicate the error. Are you using version 4.0.1 from NuGet?

TheCodeKing said...

Could you try version 4.0.2, I think that should resolve your issue.

fastlink30 said...

I tried with vs 4.0.2 (nuget), but problem remain.
This is the start routine of a service.
I must prepare the source, i must cut much code.

fastlink30 said...

The service start as localsystem

fastlink30 said...

I not see sense send the code, the service is all on the OnStart() of the service, i need initialize the communication for receive/transmit. my configuration: win7 32bit, vs 2012 ultimate, framework 4

fastlink30 said...

problem solved, there were some dll (old) in system32 that some of my libraries were referring, removed them, and now 'okay, but not understand what had nothing to do with the dll libraries xdmessaging.

TheCodeKing said...

Great I'm glad you got it working. The library implements a late binding IoC container which scans for assemblies in the same directory looking for transport implementations. I think it was falling over because it was finding a non-dotnet assembly. Soon as I get a chance I'll implement a fix.

fastlink30 said...

another little thing, the New XDMessaging.XDMessagingClient() is much slower then the previous version. I see it when i start the service, before when i start immediatly the service is ready, now i must wait some seconds.

fastlink30 said...

if XDMessagingClient fail, what is the name of the exception? (loaderexception?)

fastlink30 said...

Please update the library, when i install my program i can't execute the service becouse start scan other assemblies and give error. :(

TheCodeKing said...

Hi thanks for your feedback, could you email me from now on at mike.carlisle@thecodeking.com and we can discuss any issues.

mojodk said...

Hi,

I run my app from a readonly server share and when executing this line:

Dim client As New XDMessagingClient


... I get this error:

System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at:
System.IO.FileSystemEnumerableIterator`1.CommonInit() at:
System..IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost) at:
System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption) at:
XDMessaging.IoC.SimpleIocScanner.ScanAssemblies(String location, String searchPattern) i d:\Git\XDMessaging\XDMessaging.Net\Source\TheCodeKing.Utils\IoC\SimpleIoCScanner.cs:line 82 at:
XDMessaging.IoC..SimpleIocScanner.ScanAllAssemblies(String searchPattern) i d:\Git\XDMessaging\XDMessaging.Net\Source\TheCodeKing.Utils\IoC\SimpleIoCScanner.cs:line 57 at:
XDMessaging.IoC.SimpleIocContainerBootstrapper.Configure(IocContainer container) i :line 0 at:
TheCodeKing.Utils.IoC.SimpleIocContainer.Initialize(Action`1 configure) i d:\Git\XDMessaging\XDMessaging.Net\Source\TheCodeKing.Utils\IoC\SimpleIoCContainer.cs:line 78 at:
XDMessaging.IoC.SimpleIocContainerBootstrapper.<.cctor>b__9() i :line 0 at:
System.Lazy`1.CreateValue() at:
System.Lazy`1.LazyInitValue() at:
System.Lazy`1.get_Value() at:
XDMessaging.XDMessagingClient..ctor() i :line 0 at:

The exact error is:

Part of the path '\\myServer\myApps\myServer\myApps\' was not found.

Funny thing is, that the path is not correct, the correct path to the app is:

'\\myServer\myApps\'

So XDMessaging is combining the path wrong.

Any idea what is wrong?

Thanks

TheCodeKing said...

Hi please email me, this an issue with permissions. I will try and reproduce and implement a fix. The path is strange, no the library does not create this path itself.

ricardok1 said...

Hi there,
Can this work with .Net 2 ?
Do you know any alternative if not?
Thanks
Ricardo

TheCodeKing said...

You can use version 3.0 with .Net 2 (Install-Package XDMessaging -Version 3.0). This has a slightly different API and does not support remote networking.

There are no fundamental reasons version 4.0 couldn't work with .Net 2.0 either, it's just I've chosen to use some of the new language features. I may at some point look at adding support for .Net 2.0.

Rahul said...

Hi ..
This dll is not working with WindowService to Window application communication or vice-versa. so.. plz suggest me what should i do to communicate both each other...

TheCodeKing said...

It should work in Compatibility mode. Email me if you are having problems.

Rahul said...

Hi there...
thank u so much... it has been done... it was my mistake bcoz i was using window messaging rather than IOStream.. tht's why i was unable to do it. .. but now using IOStream i am able to communicate thru window service. so thank you very much...

B R

Deep Sea said...

The amazon transport is a nice feature but it increased the distribution size nearly 10x! This is extremely difficult when all I am using it for local IPC communication. Do you have a branch with it removed? If not I would like to submit my modified project as a branch. I have removed everything except what is required to support local communications.

TheCodeKing said...

Yes I think that's the Amazon SDK! I could look at stripping that back, I'm just embedding the unmodified lib at the moment.

The idea of the new architecture is that you don't need all of the DLLs. If you're not using Amazon Transport, just remove the reference and don't include in your distribution.

As transports are loosely coupled, you can remove these references without any impact. Drop me a mail if you have any more questions/problems.

Rahul Saraswat said...

Hi, I am using XDMessaging dll in Mono.net under LINUX, it is unable to communicate. I got an runtime exception whatever i use any transport mode. MailSlot Exception. Please help me....

TheCodeKing said...

Hi are you using an older version of XDMessaging? The latest does not use MailSlots. I doubt HighPerformanceUI mode will work as this relies on Windows Messaging and low level Windows APIs outside of .NET. You may be able to get IOStream or RemoteNetwork to work, but it hasn't been tested with Mono. You can grab the latest verison from http://thecodeking.github.io/XDMessaging.Net.

Curtis Jingle said...

Hi, I've built a Windows Service that broadcasts it's status. It's using the XDTransportMode.Compatibility (so the XDMessaging folder gets created). Unfortunately, I keep getting the following error:

UTC: 2014-01-29 00:54:13,458
Local: 2014-01-29 00:54:13,458
Level: ERROR
Location: ABSePartsTraderService.Controllers.ProcessController.InitiateMessaging(d:\NetProjects\Mitchell\PartsTrader\ABSePartsTraderService\ABSePartsTraderService\Controllers\ProcessController.cs:176)
Message: Initiate Messaging Error
Exception: System.MissingMethodException: Constructor on type 'XDMessaging.Transport.IOStream.XDIoStreamListener' not found.
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
at XDMessaging.Utils.IoC.IocActivator.CreateInstance(Type type) in d:\NetProjects\Mitchell\PartsTrader\XDMessaging.Utils\IoC\IoCActivator.cs:line 53
at XDMessaging.Utils.IoC.SimpleIocContainer.<>c__DisplayClass4.b__3(IocActivator a) in d:\NetProjects\Mitchell\PartsTrader\XDMessaging.Utils\IoC\SimpleIoCContainer.cs:line 150
at XDMessaging.Utils.IoC.SimpleIocContainer.<>c__DisplayClass19.b__16(IocActivator a) in d:\NetProjects\Mitchell\PartsTrader\XDMessaging.Utils\IoC\SimpleIoCContainer.cs:line 266
at XDMessaging.Utils.IoC.SimpleIocContainer.Resolve(Type type, String name) in d:\NetProjects\Mitchell\PartsTrader\XDMessaging.Utils\IoC\SimpleIoCContainer.cs:line 240
at XDMessaging.Utils.IoC.IocContainerExtensions.Resolve[T](IocContainer container, String name) in d:\NetProjects\Mitchell\PartsTrader\XDMessaging.Utils\IoC\IoCContainerExtensions.cs:line 65
at XDMessaging.Entities.Listeners.GetListenerForMode(XDTransportMode transportMode)
at ABSePartsTraderService.Controllers.ProcessController.InitializeMode(XDTransportMode mode) in d:\NetProjects\Mitchell\PartsTrader\ABSePartsTraderService\ABSePartsTraderService\Controllers\ProcessController.cs:line 188
at ABSePartsTraderService.Controllers.ProcessController.InitiateMessaging(ILog logger) in d:\NetProjects\Mitchell\PartsTrader\ABSePartsTraderService\ABSePartsTraderService\Controllers\ProcessController.cs:line 170

This is working on my development machine, but not on my test machine where this service is deployed. I verified the Windows Service user has full access rights to the folder generated by XDMessaging. Do you have any suggestions?

Thanks,

TheCodeKing said...

Hi Curtis, it's possible the test machine isn't running with full trust permissions and therefore can't construct the listener instance. What OS is the test machine? Is the assembly blocked?

Rahul said...

Dear Sir,
I am using XDMessaging dll into mono.net under Linux environment. I get an exception on this line - XDListener.CreateListener(XDTransportMode.IOStream);

or any other mode. Please suggest me about this problem. The exception is like this -:

Unhandled Exception:
System.EntryPointNotFoundException: CreateMailslot
at (wrapper managed-to-native) TheCodeKing.Net.Messaging.Concrete.MailSlot.Native:CreateMailslot (string,uint,int,intptr)
at TheCodeKing.Net.Messaging.Concrete.MailSlot.MailSlotReader.GetFileHandle (System.String mailSlotLocation) [0x00000] in :0
at TheCodeKing.Net.Messaging.Concrete.MailSlot.MailSlotReader.Listen (System.Action`1 callback) [0x00000] in :0
at TheCodeKing.Net.Messaging.Concrete.MailSlot.MailSlotWatcher.b__0 () [0x00000] in :0
The application exited with code: 255

TheCodeKing said...

I replied above, it looks like you are using an old version of the library. Please email me or open an issue on Github.

Rahul Saraswat said...

Sir, Thank you so much for you reply. I downloaded project from Github to use new version. When i try to add reference for this new version XDMessaging.dll into my VS2008 version project, it not success to add. but, it is being added successfully in VS2012 project. Please suggest me what should i do. because i have to use it in mono.net under Linux platform. I think as Mono.net supports only VS2008 framework dll till now.

TheCodeKing said...

Hi Ruhal, if you can email me the details I'll try and help out. Email is top of the page.

Ali Doang said...

Hi, thank you for the useful post.
I have problem when compiling the demo solution there is error the command "xcopy /Y " bla..bla. there are 3 rows
and last row is exited with code 2.
thanks for your help.

TheCodeKing said...

Hi, where did you get the source from? The download or checkout from Github? Did you open the project directly? Try openning the solution. The Xcopy is a post deploy step to copy the output to the top level bin directory.

Ali Doang said...

Thank you for your quick reply. yes I download from Github and open directly from project.
I try open from the solution its work. no error. thank you

Ali Doang said...

Hi, I need your help again.
when I change Mode to Remote Network its pop up error with details below, can you help me how to solve this?

Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceException: The security token included in the request is invalid
at Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient.Invoke[T](IDictionary`2 parameters)
at Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient.CreateTopic(CreateTopicRequest request)
at XDMessaging.Transport.Amazon.Facades.AmazonSnsFacade.CreateOrRetrieveTopic(String name) in d:\Git\XDMessaging\XDMessaging.Net\Source\XDMessaging.Transport.Amazon\Facades\AmazonSnsFacade.cs:line 58
at XDMessaging.Transport.Amazon.Repositories.TopicRepository.GetTopic(String channelName) in d:\Git\XDMessaging\XDMessaging.Net\Source\XDMessaging.Transport.Amazon\Repositories\TopicRepository.cs:line 55
at XDMessaging.Transport.Amazon.XDAmazonListener.RegisterChannel(String channelName) in d:\Git\XDMessaging\XDMessaging.Net\Source\XDMessaging.Transport.Amazon\XDAmazonListener.cs:line 114
at TheCodeKing.Demo.Messenger.InitializeMode(XDTransportMode mode) in D:\Working Folder\interprocessapp\TheCodeKing-XDMessaging.Net-68d455b\Demo\C#\Messenger\Messenger.cs:line 163
at TheCodeKing.Demo.Messenger.SetMode() in D:\Working Folder\interprocessapp\TheCodeKing-XDMessaging.Net-68d455b\Demo\C#\Messenger\Messenger.cs:line 277
at TheCodeKing.Demo.Messenger.ModeCheckedChanged(Object sender, EventArgs e) in D:\Working Folder\interprocessapp\TheCodeKing-XDMessaging.Net-68d455b\Demo\C#\Messenger\Messenger.cs:line 399
at System.Windows.Forms.RadioButton.OnCheckedChanged(EventArgs e)
at System.Windows.Forms.RadioButton.set_Checked(Boolean value)
at System.Windows.Forms.RadioButton.OnClick(EventArgs e)
at System.Windows.Forms.RadioButton.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Asif Rahman said...

Hi, firstly thanks much for the library!! I have been using it to some good effect. I've written a sticky window manager that allows windows to be locked, resized and moved together. I have 4 multi apps talking to each other over XD. Basically I am using RX over XDMessaging for this, works great. Another developer on my team claims XD uses string serialization, is this true? Are all strongly typed objects serialized into strings and sent using WM_COPYDATA? Any light you can shed on this and its efficiency would help a lot! Thanks again.

TheCodeKing said...

Yes, in HighPerformance mode, when sending typed objects, then the object will first be serialised into a string. A pointer to the DataGram struct is then shared via WM_COPYDATA with other processes, where it is read and copied. You cannot pass a reference type between processes, so it must first be serialised.

Ali Doang said...

Hi..what kind of amazon's services should I subscription to running in RemoteNetwork Mode?

TheCodeKing said...

Hi, you need an account with SNS and SQS enabled. Make sure the access credentials have read/write as the library will create resources as required.

Mike

Post a Comment