locked
Message broadcasting without SignalR RRS feed

  • Question

  • User1835401063 posted

    Hello

    My question is out of the box, hope somebody can help or refer me to correct forum.

    I need to host a very simple web site with an economy hosting company. They do not let SignalR on their shared plans. Maybe some dlls of SignallR could be partially used or not, have no Idea.

    Why I need SignalR? a very simple task:

    Many clients connect to this server via webservice. They provide data and services for each other. I want to  notify one client that its response is ready, then it will automatically login to web service and read what ever necessary. The only thing that I'm concerned about is that clients don't flood server with very frequent checks of if answer is ready. 

    So, my task for broadcasting even doesn't need authentication. a live stream of client codes need to be posted to all clients. whenever each client receives his own code, he will login and do the stuff. broadcasting is not even mission critical, if a message is lost, client will check for updates by logging in to server once a minute. This whole system is to avoid logging in once every millisecond.

    First thing that crossed my mind was implementing a udp server that all clients connect to the same socket. It needs to keep application alive with fake requests so that we have a place for instansiating udp objects. Then I thought this system may be consuming the same amount of resources in background that floding the server with usual http requests.

    So, at the end, I'm here. need some guide how to implement such system. at the beginning it seems very easy, but harder than expected. OR You may guide me that SignalR is the only answer and try to upgrade to a higher hosting plan.

    Thanks in advance

    Monday, November 9, 2020 4:53 PM

All replies

  • User475983607 posted

    What kind of client?  I assume a machine and not a browser.   Send a message to the machine when the data is ready. 

    Monday, November 9, 2020 7:28 PM
  • User753101303 posted

    Hi,

    Do you mean the websocket feature is disabled. AFAIK SignalR is supposed to fallback to other methods if SignalR  websocket is not available.

    Another option could be to explore https://caniuse.com/?search=eventsource (never tried yet myself, I assume clients are browsers ?)

    Monday, November 9, 2020 9:08 PM
  • User1835401063 posted

    Hello

    How to send a message? Is there any mechanism available other than email? I was searching how such messages were sent "online" before SignalR appeared.

    Tuesday, November 10, 2020 2:44 AM
  • User1835401063 posted

    Hello

    "Event source" is designed to work with browser, I have a c# client. By the way you directed me to a good point. 

    How does this concept of eventsource work? do they keep an http connection alive by sending dummy pings for hours and days? Can I reproduce the same behavior using HttpClient and IHttpHandler?

    It may be the answer: keeping an http session alive needs less frequent pings/messages than checking for process finished.

    Fall back of this method is that an http channel(resource) is kept idle, compared to operating a shared udp socket. but better than frequent checks for update.

    Tuesday, November 10, 2020 3:15 AM
  • User475983607 posted

    How to send a message? Is there any mechanism available other than email? I was searching how such messages were sent "online" before SignalR appeared.

    SignalR is a real-time persistent connection framework based on Web Sockets.  This technology is mostly used in browser based applications.  Modern browser come with an Web Socket API controlled through JavaScript.  It is possible to use other clients like C# but this requires an installation on the client machines.  

    Socket programming is not a new idea.  It's new for browsers...

    If you were to build a UPD server then you are faced with the same issue.  You have to write a client application (listener) and install the app on all  clients.   So again, what are the clients?  Do you have access to install code on the clients?

    Tuesday, November 10, 2020 3:24 AM
  • User1835401063 posted

    So again, what are the clients?  Do you have access to install code on the clients?

    Yes, I do have access to client machines. The whole project is about desktop applications, not browsers.

    Tuesday, November 10, 2020 4:07 AM