0

I was assigned to make 2 servers and a client application.

  • My service must generate random number from 1-100 every second.
  • Server A must display random numbers generated from a service.
  • Server B must receive same feeds displayed by Server A from the service.
  • Then the Client Application must receive same feeds received by Server B.

I know this would be about callbacks but I don't really know where to start. I tried to code, Server A and Server B displays the same but sometimes not and I know it is all wrong. Please help. I've been working with it for three days.

Mike
  • 47,263
  • 29
  • 113
  • 177
Brenelyn
  • 593
  • 4
  • 8
  • 15
  • In my server A, I host and call my service at the same time so that the generated numbers will be displayed but through callbacks. In my server B, I also call my service but its callback was from Server A. I assume it will do because they both have the same class that was using for callbacks. Sometimes they generate same feeds but mostly not. I know there's something wrong but I don't know where and how to fix it. – Brenelyn Dec 05 '12 at 06:57
  • Don't lose hope. Why do you have to use callbacks? Callbacks are complicated and unreliable. It's better to use one-way, asynchonous calls. – tom redfern Dec 05 '12 at 09:46
  • _"but sometimes not and I know it is all wrong. Please help. I've been working with it for three days."_ - we can't help with this. You can either ask for a global design hint at [programmers](http://programmers.stackexchange.com/), or ask a question about a specific piece of code and its resulting bugs here. – CodeCaster Dec 05 '12 at 13:02

1 Answers1

0

Sounds like you might need to implement a simple pub/sub system for this to work nicely. http://msdn.microsoft.com/en-us/magazine/cc163537.aspx - if you're using WCF..

Because you don't really supply any specifics - I would have thought that you first need to connect server A and B to be subscribers to the Random Number event. And the client to have a different subscription based on what A and B do..

So the workflow is this... Server A makes call to the random number service periodically... When it recieves its response it publishes a message which server B and Client is subscribed to.. Each time this happens Server B and Client receive an event. Again see the link I supplied for more detailed info..