0
votes

I have the SignalR service in AWS EC2. I want to set backplane with the Redis engine Elasticache. I can connect with redis-cli tool to Easticache in the SignalR server successfully.

C:\>redis-cli -h server.cache.amazonaws.com -p 6379 ping
PONG

But when I put the backpalne setting code, the SignalR returns

SignalR: webSockets transport timed out when trying to connect.

Without the backplane setting code

GlobalHost.DependencyResolver.UseRedis(server, port, string.Empty, appName);

It works well.

Error message follows

[03:31:21 GMT+0000 (Coordinated Universal Time)] SignalR: Negotiating with 'http://server.elb.amazonaws.c…Protocol=1.5&connectionData=%5B%7B%22name%22%3A%22notificationhub%22%7D%5D'.VM47 jquery.signalR-2.2.0.min.js:8  

[03:31:28 GMT+0000 (Coordinated Universal Time)] SignalR: webSockets transport starting. VM47 jquery.signalR-2.2.0.min.js:8

[03:31:28 GMT+0000 (Coordinated Universal Time)] SignalR: Connecting to websocket endpoint 'ws://server.elb.amazonaws.com/signalr/connect?transport=webSockets&clientProtocol=1.5&connectionToken=xSWImxTslxzzk4toiMzjuNod56GaOF27NaT1t1ZkACbNqMC%2BhVRvEFtc2MesygYDRY1ULm%2BtFSo4djNegjcNtuD6lpk1pQQ7ecVZoLFr6aPJ%2FP0HHhUmAjgOVs1FyqQt&connectionData=%5B%7B%22name%22%3A%22notificationhub%22%7D%5D&tid=9'. VM47 jquery.signalR-2.2.0.min.js:8  

[03:31:28 GMT+0000 (Coordinated Universal Time)] SignalR: webSockets transport starting. VM47 jquery.signalR-2.2.0.min.js:8  

[03:31:33 GMT+0000 (Coordinated Universal Time)] SignalR: webSockets transport timed out when trying to connect. VM47 jquery.signalR-2.2.0.min.js:8  

[03:31:33 GMT+0000 (Coordinated Universal Time)] SignalR: Closing the Websocket.
 index.html#/intro:1 WebSocket connection to 'ws://server.elb.amazonaws.com/signalr/connect?transport=webSockets&clientProtocol=1.5&connectionToken=xSWImxTslxzzk4toiMzjuNod56GaOF27NaT1t1ZkACbNqMC%2BhVRvEFtc2MesygYDRY1ULm%2BtFSo4djNegjcNtuD6lpk1pQQ7ecVZoLFr6aPJ%2FP0HHhUmAjgOVs1FyqQt&connectionData=%5B%7B%22name%22%3A%22notificationhub%22%7D%5D&tid=9' failed: WebSocket is closed before the connection is established. VM47 jquery.signalR-2.2.0.min.js:8

[03:31:33 GMT+0000 (Coordinated Universal Time)] SignalR: Websocket closed.

Update

After i installed redis locally in the server, same problem is occurred. It looks like not AWS Elasticache problem.

1
Try to run the server locally connecting to Redis on AWS and check if you have any exceptions in your server.Pawel
Thank you, I installed local Redis and webSockets transport timed out problem is occurred. It was not AWS Elasticache problem. but I have not any exception my server.Chris
The idea is not to install Redis locally but to use Redis on AWS with a SignalR server running locally if you get the same issue it will be much easier to troubleshoot.Pawel
I'm sorry I mean that I installed Redis on AWS EC2 instance with SignalR server.Chris

1 Answers

1
votes

It turns out ELB problem, I increase TransportConnectionTimeout value in the SignalR server.

GlobalHost.Configuration.TransportConnectTimeout = TimeSpan.FromSeconds(1);

The problem resolved.