Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Windows Services and MSMQ to communicate with them (if you even need to).</p> <p>-- Edit</p> <p>To slightly expand.</p> <p>You'll create several services, depending on what you want to do, and have them all run an endless thread of various sleeping levels, to do what you want. They will then update the database appropriately, and you will not have had to do anything on the client side.</p> <p>You may wish to interact with them from an admin point of view, hence you may have an MSMQ that they listen to admin commands on. Depending on your implementation, you may need to restart them for some reason, or possibly just 'force' a running of whatever they wish to do.</p> <p>So you'll use an MSMQ Private Queue to do it (System.Messaging namespace). One of the main things to note about MSMQ, is that message need to be &lt; 4meg. So if you intend to send large object graphs, serialise to a file first and just send the filename.</p> <p>MSMQ is quite beautiful. You can send based on a 'Correlation ID' if you need to, but, for some amusing reason, the correlation ID must be in the form of:</p> <pre><code>{guid}\1 </code></pre> <p>Anything else does not work (at least in version 2.0 of the framework, the code may have changed).</p> <p>-- Edit</p> <p>Example, as requested:</p> <pre><code>using System.Messaging; ... MessageQueue queue = new MessageQueue(".\\Private$\\yourqueue"); queue.Formatter = new BinaryMessageFormatter(); Message m = new Message(); m.Body = "your serialisable object or just plain string"; queue.Send(m); // on the other side MessageQueue queue = new MessageQueue(".\\Private$\\yourqueue"); queue.Formatter = new BinaryMessageFormatter(); Message m = queue.Receive(); string s = m.Body as string; // s contains that string now </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload