<p>My problem is that I want to have a server application (on a remote computer) to publish certain events to several client computers. The server and client communicate using .Net-Remoting so currently I am using remoted .Net-Events to get the functionality. But there is one drawback: when the server (the event publisher) comes offline and is restarted, the clients lose the connection since the remote object references become invalid.</p>

<p>I am looking into Loosely Coupled Events and Transient COM Subscriptions to solve this issue. I put together a small demo application with one publisher and two subscribers. It works beautifully on one computer.  </p>

<p>I am using the COMAdmin-Libraries to create a transient subscription for the event subscribers. The code looks like this:</p>

<pre><code>MyEventHandler handler = new MyEventHandler();
ICOMAdminCatalog catalog;
ICatalogCollection transientCollection;
ICatalogObject subscription;
catalog = (ICOMAdminCatalog)new COMAdminCatalog();
transientCollection = (ICatalogCollection)catalog.GetCollection("TransientSubscriptions");
subscription = (ICatalogObject)transientCollection.Add();
subscription.set_Value("Name", "SubTrans");
subscription.set_Value("SubscriberInterface", handler);
string eventClassString = "{B57E128F-DB28-451b-99D3-0F81DA487EDE}";
subscription.set_Value("EventCLSID", eventClassString);
string sinkString = "{9A616A06-4F8D-4fbc-B47F-482C24A04F35}";
subscription.set_Value("InterfaceID", sinkString);
subscription.set_Value("FilterCriteria", "");
subscription.set_Value("PublisherID", "");
transientCollection.SaveChanges();
handler.Event1 += OnEvent1;
handler.Event2 += OnEvent2;
</code></pre>

<p>My question now is: what do I  have to change in the subscription to make this work over a network? Is it even possible?</p>

[{'answer_id': 81843, 'author': 'Hallgrim', 'author_id': 15454, 'author_profile': 'https://Stackoverflow.com/users/15454', 'pm_score': 0, 'selected': False, 'text': '<p>If your server comes offline every once and a while I cannot see how you can avoid to poll it to check that it is alive.</p>\n'}, {'answer_id': 81961, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': '<p>What about MSMQ?  It seems perfect for what you are trying to achieve?  You can use a traditional publish/subscribe model or multicast the messages.</p>\n'}, {'answer_id': 81979, 'author': 'Lee Gathercole', 'author_id': 15204, 'author_profile': 'https://Stackoverflow.com/users/15204', 'pm_score': 1, 'selected': False, 'text': "<p>This might be a step too far, but have you considered using WCF and the callback element of WCF?</p>\n\n<p>Callback effectively turns the what was client into a server. To be honest, I don't know a great deal about callback and have only experimented. Perhaps worth a 10 minute google though.</p>\n"}, {'answer_id': 201201, 'author': 'csgero', 'author_id': 21764, 'author_profile': 'https://Stackoverflow.com/users/21764', 'pm_score': 0, 'selected': False, 'text': "<p>As you are talking about COM and remote computers, I suspect you'll have to do some DCOM security configuration.</p>\n"}]
['https://Stackoverflow.com/questions/80903', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9602/']