How to send data using Azure SignalR Service from a JS SignalR client to a C# SignalR client?

Adwait Naik 45 Reputation points
2024-06-10T10:09:52.6833333+00:00

Hello there,

I have two signalR clients: ClientA is based on JavaScript and ClientB is based on C#. The objective is to send user input from ClientA and to ClientB. Both clients are completely different and don't belong to the same group. The signalR service operates in Serverless mode.

I tried using the same target method, "newMessage" but it doesn't work. Is there an example of this scenario? Could you suggest a blog or an example on GitHub?

Thanks

Azure SignalR Service
Azure SignalR Service
An Azure service that is used for adding real-time communications to web applications.
131 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sander van de Velde | MVP 30,711 Reputation points MVP
    2024-06-10T11:50:01.28+00:00

    Hello @Adwait Naik ,

    welcome to this moderated Azure community forum.

    You have two clients connected to the same SignalR hub.

    You want to send a message from one client to another.

    Have you considered sending a messa to the hub first?

    You can use the hub for sending the message to the other client (if you know the id) or multiple clients (and have the filtering done in all clients), or even create groups?

    Check out the basic chat example of SignalR for more details. Take some time to experiment what method is the best for you.


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.

    0 comments No comments