I have yet to understand why people are afraid of SignalR.

Everything you need to know for SignalR for Web Pages is summarized at:

The APIs are really simple. It is a case of understanding your user account, room information, and message structure. After that, its all in figuring your use cases.

  1. Do we persist messages
  2. Are rooms (groups) persistable
  3. Can users accumulate offline messages
  4. Who can join?
  5. What rooms can they join?
  6. How much detail is in a message, and what is the message structure.
    1. Plain text
    2. HTML
    3. MD
    4. other
  7. Does the server need to sanitize the message?
  8. Are messages simple posts, or complex structures
  9. etc.

So why SignalR rather than WebSockets? Because WebSockets don’t exist on all browsers yet. SignalR uses existing technology to overcome that limitation, until the day comes that everyone can use WebSockets.

Note: I don’t believe in the “versus” discussions on WebSockets + node.js vs SignalR + C#. This is silly. My ideal environment would be to make it so I can support Node.JS or C# hosts, and SignalR clients that can handle WebSockets. That way I can cover the widest range of compatibility without being married to one platform.

Advertisements
This entry was posted in Brian's Code Extreme and tagged , , , , . Bookmark the permalink.

2 Responses to I have yet to understand why people are afraid of SignalR.

  1. David says:

    How do you persist messages? I want to keep the same thread of messages regardless how many windows/tab the user has opened in the same session

    • Brian Dead Rift Webb says:

      Define the room(group), then store the room’s message in a DB. If it is a one on one message, then define the user by his authentication, and store the message with a table that has two keys: FromID and ToID.

      When you load from history, I would pull the history up in a web api, and retrieve it as a json file, then have a JavaScript MVC like React.JS or Angular.JS add the data to your client model, so that it can render the history to screen.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s