Example: 01_PublishSubscribe, Subscribe/ Unsubscribe, Application crash problem?

Dec 1, 2010 at 9:54 PM

Hello XcoAppSpace Team.

First of all, thanks for your great solution.

I like the idea and how you have solved. Amazing job. It saves me a lot of time and the flexibily rise up as well.

Thanks for!

By using I have found two issues. I will post within this thread and the second at a new one.May you have a idea or solution.

First the easy one to describe.

I have build an similar solution you have presented here: 


and deliver by your "Usage Demos\02_Advanced\01_PublishSubscribe".

I noticed and issue, if client 1 or client 2 get closed without UNSUBSRIBE from worker port (exit or crash). If this happens the other still running client connection seems to disappear also and the server can not be reconneced until its get restarted.

It is testable by using your test case "01_PublishSubscribe" and just 
replace your code part:

Thread.Sleep(3000); //give clients some time to subscribe

by this code part:

        Console.WriteLine("Press any key to start");
	var run = true;
	var line = string.Empty;
	while (run)
		Console.WriteLine("Posting two news items...");
		w.Post(new PublishNews { Publisher = "peter", NewsItem = "greetings from peter" });

		line = Console.ReadLine();

		if (string.IsNullOrEmpty(line)) continue;

		run = false;

	Console.WriteLine("Press any key to close");

The code change makes just sure to keep the server running. It should change the general behaviour. Or!? But I have no idea why all connections are crashing. May you kown why?


Dec 3, 2010 at 2:30 PM

Hello, Roberto!

We are glad to hear that you like the Application Space!

Concerning your problem, I tried out the Publish/Subscribe example and inserted the code you posted. Unfortunately, it seems that I cannot completely replicate your error. When I close one of the clients, I can see that for messages that are posted afterwards there is a few seconds of time lag. This lag lasts for about 10 seconds and then disappears (this is the time that the XcoPublisher needs to recognize that one of the clients has crashed, and removes the crashed client from the publishing list - although I'm not completely sure why I'm getting this lag at all - I will look further into this). But, despite of this lag, I don't have any problems getting published messages with the remaining client.

Here is what I did:

  • started application
  • published some messages with the server
  • closed either client 1 or 2 (tried both ones)
  • published some more messages (-> lag for about 10 seconds in message delivery, after that the messages are published normally to the remaining client)

Did I miss something?

There were some improvements to XcoPublisher with the last AppSpace version released in October - did you use this one?


Dec 7, 2010 at 12:36 PM

Hello Thomas.

Thanks for your try. Yes I downloaded your latest files for my tests. Strange why you can'nt replicate this.

I will test soon again and within an different workstation and server. I will post my results again here.


Jan 20, 2011 at 2:41 PM


Is there a solution for it? I have the same problem.




Jan 21, 2011 at 12:23 PM
Edited Jan 21, 2011 at 12:23 PM

Hi Sanja,

Have you also tried this with the latest version from SVN? There are some small improvements compared to the current release, perhaps they can prevent the error.

Despite of that, please tell me if you have any hints on how I can replicate this error.


Jan 27, 2011 at 9:54 AM
Edited Jan 27, 2011 at 9:55 AM

After I have compiled the last version from SVN, the whole application runs solidly.

Thanks for the help.



Jun 17, 2011 at 4:57 PM

Hello Thomas.


Yes this issue is gone away by using the latest source code.

I needed some productive runtime to be sure ;-)




Jun 20, 2011 at 7:19 AM

Glad to hear that!