olofd / react-native-signalr

Use SignalR with React Native
150 stars 61 forks source link

Clients.Group(ChannelId) does not work when using backplane #30

Closed kevinNgws closed 7 years ago

kevinNgws commented 7 years ago

Hi, Im using Redis as backplane for my server which is behind a AWS Load balancer.

The simulated environment as follows: Clients: Client 1: Web browser with Signalr JS installed Client 2: React-native app

Server: C# Server with Signalr and Signalr Redis installed

When a client join a chat room, it will invoke a server method (JoinChat) and the server will broadcast a message to everyone who is inside the chat, including the one who has just joined.

The server side coding as follows: await Groups.Add(Context.ConnectionId, chatId); Clients.Group(chatId).addTextFromServer("Joined this chat)";

Client 1 received the message with no issue Client 2 failed to receive the message

Please advise.

kevinNgws commented 7 years ago

I managed to get it working with the below steps:

  1. Turn on stickiness for AWS load balancer
  2. Configure a machine key in the iis
  3. Switch from HTTP 80 to TCP 80 at the load balancer

Client 1 (Web browser with Signalr JS installed) still works irregardless of the changes.