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

Dec 1, 2010 at 8: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: 

http://xcoappspace.codeplex.com/wikipage?title=PubSubFeature

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");
	Console.ReadLine();
	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" });
		Thread.Sleep(200);

		line = Console.ReadLine();

		if (string.IsNullOrEmpty(line)) continue;

		if(line.ToLower().Contains("exit"))
		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?


Regards
Roberto

Coordinator
Dec 3, 2010 at 1: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?

Regards
Thomas

Dec 7, 2010 at 11:36 AM

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.

Regards
Roberto

Jan 20, 2011 at 1:41 PM

Hello,

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

 

Regards

sanja

Coordinator
Jan 21, 2011 at 11:23 AM
Edited Jan 21, 2011 at 11:23 AM

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.

Regards
Thomas

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

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

Thanks for the help.

Regards

sanja

Jun 17, 2011 at 3:57 PM

Hello Thomas.

 

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

I needed some productive runtime to be sure ;-)

 

Regards

Roberto

Coordinator
Jun 20, 2011 at 6:19 AM

Glad to hear that!

Thomas