Click here to Skip to main content
15,920,005 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to preview office file in windows app 8.1 using C# Pin
Frank Kerrigan4-Mar-16 3:52
Frank Kerrigan4-Mar-16 3:52 
GeneralRe: How to preview office file in windows app 8.1 using C# Pin
Shaimaa Fawzy5-Mar-16 5:53
Shaimaa Fawzy5-Mar-16 5:53 
QuestionObserver Pattern with Remote Machines Pin
Bernhard Hiller2-Mar-16 0:54
Bernhard Hiller2-Mar-16 0:54 
QuestionRe: Observer Pattern with Remote Machines Pin
dan!sh 2-Mar-16 1:42
professional dan!sh 2-Mar-16 1:42 
AnswerRe: Observer Pattern with Remote Machines Pin
Bernhard Hiller2-Mar-16 2:58
Bernhard Hiller2-Mar-16 2:58 
GeneralRe: Observer Pattern with Remote Machines Pin
Sascha Lefèvre2-Mar-16 3:39
professionalSascha Lefèvre2-Mar-16 3:39 
GeneralRe: Observer Pattern with Remote Machines Pin
Bernhard Hiller2-Mar-16 20:54
Bernhard Hiller2-Mar-16 20:54 
GeneralRe: Observer Pattern with Remote Machines Pin
dan!sh 2-Mar-16 23:00
professional dan!sh 2-Mar-16 23:00 
OK, so we have something similar (I guess) here that uses SignalR. We keep track of connected clients on the server side. Now, if any client is disconnected, server marks it. The client will then try and reconnect. When that happens, it is unmarked. During this time, if any message was sent, we know how many clients have not received it. So we send it across. Here are the steps we used:
  1. When the client first connects, it sends a unique value that helps identification (since SignalR connectionIds are not persistent).
  2. This is saved in dictionary with value as true (for connected).
  3. When the client is disconnected, the value is set to false.
  4. When the notification is sent from server to client, we check if there is any client with value as false in the dictionary. If yes, we save the client identifiers.
  5. Next time they connect, the notification is sent again.
So, in drone-sheep-wolf-dog scene,
  1. Drone notes all the dogs available.
  2. If any dogs runs away to eat grass or whatever, it makes note of that too.
  3. If a wolf is noticed, all dogs are notified. Drone also knows one dog is not there and will need to notify this dog later.
  4. As soon as dog is back, it is send message.
  5. If any new dog joins in, that too gets the message.
Now, this assumes that drone is always functional. If drone can fail to retain this information, it can be saved to database. In that case, on any new connection, check drone cache and also database for any pending messages.
"You'd have to be a floating database guru clad in a white toga and ghandi level of sereneness to fix this goddamn clusterfuck.", BruceN[^]

AnswerRe: Observer Pattern with Remote Machines Pin
Pete O'Hanlon2-Mar-16 5:52
mvePete O'Hanlon2-Mar-16 5:52 
GeneralRe: Observer Pattern with Remote Machines Pin
Bernhard Hiller2-Mar-16 20:58
Bernhard Hiller2-Mar-16 20:58 
GeneralRe: Observer Pattern with Remote Machines Pin
Pete O'Hanlon2-Mar-16 21:08
mvePete O'Hanlon2-Mar-16 21:08 
AnswerRe: Observer Pattern with Remote Machines Pin
BillWoodruff2-Mar-16 6:43
professionalBillWoodruff2-Mar-16 6:43 
GeneralRe: Observer Pattern with Remote Machines Pin
Bernhard Hiller2-Mar-16 21:24
Bernhard Hiller2-Mar-16 21:24 
AnswerRe: Observer Pattern with Remote Machines Pin
BillWoodruff2-Mar-16 21:54
professionalBillWoodruff2-Mar-16 21:54 
AnswerRe: Observer Pattern with Remote Machines Pin
Super Lloyd5-Mar-16 19:01
Super Lloyd5-Mar-16 19:01 
GeneralRe: Observer Pattern with Remote Machines Pin
Bernhard Hiller6-Mar-16 21:30
Bernhard Hiller6-Mar-16 21:30 
GeneralRe: Observer Pattern with Remote Machines Pin
Super Lloyd6-Mar-16 23:04
Super Lloyd6-Mar-16 23:04 
QuestionReflection for non public type in Unit Testing Pin
Member 91405151-Mar-16 18:23
Member 91405151-Mar-16 18:23 
AnswerRe: Reflection for non public type in Unit Testing Pin
Bernhard Hiller1-Mar-16 21:26
Bernhard Hiller1-Mar-16 21:26 
GeneralRe: Reflection for non public type in Unit Testing Pin
Member 91405152-Mar-16 19:18
Member 91405152-Mar-16 19:18 
GeneralRe: Reflection for non public type in Unit Testing Pin
Bernhard Hiller2-Mar-16 20:42
Bernhard Hiller2-Mar-16 20:42 
AnswerRe: Reflection for non public type in Unit Testing Pin
BillWoodruff2-Mar-16 2:53
professionalBillWoodruff2-Mar-16 2:53 
GeneralRe: Reflection for non public type in Unit Testing Pin
Member 91405152-Mar-16 19:37
Member 91405152-Mar-16 19:37 
QuestionInput format was not in correct format for int? Followed by "Invalid expression term try" Pin
Sam 91001-Mar-16 8:26
Sam 91001-Mar-16 8:26 
AnswerRe: Input format was not in correct format for int? Followed by "Invalid expression term try" Pin
Eddy Vluggen1-Mar-16 9:07
professionalEddy Vluggen1-Mar-16 9:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.