Mohamed Naguib
Mohamed Naguib

Reputation: 1730

SignalR connection is endless

I have a signalR connection working but something very weird happens, sometimes it works perfectly in very few seconds and other times when I track the request it took more than 10 minutes trying to connect and it gives me something like that

enter image description here

can anyone give me an explanation for this? any hints, how to search for the problem

Upvotes: 0

Views: 221

Answers (1)

halter73
halter73

Reputation: 15244

The request your looking at: /connect?transport=serverSentEvents&... is supposed to be endless.

SingalR is using comet technology called server-sent events or SSE. The basic idea is that SignalR responds to SSE requests in chunks, but never actually closes the response unless the client asks it to.

Browsers with SSE support can read the chunks sent from the server as they are sent even though the response doesn't end. This allows an unlimited number of messages to be sent in response to a single request.

Upvotes: 2

Related Questions