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.
151 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sander van de Velde | MVP 33,956 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 message 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 you use the SDK of your language, the functionality offered is the same in any language.

    Check this page with information about the clients available (eg. .Net client and Javascript client) .

    This page offers an example running the Java script client.


    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.