Why SignalR Server Sent Events (SSE) transport connects repeatedly every minute?

0

We are using Microsoft.AspNet SignalR Version=2.4.1.0 running on Windows Server 2016, IIS 10. In our logs, we see that client send us connect request to set up WebSocket connection and server return HTTP status code of 101. Immediately after that, we receive another connect request to set up SSE connection. Almost every minute, the SSE connection terminate and there is a new cycle of negotiate, connect (WebSocket), connect (SSE), start requests. Here are SignalR settings configured on our server.

ConnectionTimeout = 60s
DisconnectTimeout = 10s
KeepAlive = 3s
TransportConnectTimeout = 30s

Here are how requests look in the log. There are two connect requests one after another. First connect request is for WebSocket and second connect request is for SSE.


Time                         Request
2020-09-26 00:47:46.4422081 /signalr/negotiate
2020-09-26 00:47:46.6668475 /signalr/connect
2020-09-26 00:48:06.6426133 /signalr/connect
2020-09-26 00:48:06.7032692 /signalr/start
2020-09-26 00:48:06.7768225 /signalr/send
2020-09-26 00:48:06.7950440 /signalr/send
2020-09-26 00:48:51.7756981 /signalr/negotiate
2020-09-26 00:48:52.0176240 /signalr/connect
2020-09-26 00:48:52.1911200 /signalr/connect
2020-09-26 00:48:52.3027074 /signalr/start
2020-09-26 00:48:52.3556187 /signalr/send
2020-09-26 00:48:52.3799213 /signalr/send
2020-09-26 00:49:49.6689214 /signalr/negotiate
2020-09-26 00:49:49.8595736 /signalr/connect
2020-09-26 00:50:03.6478671 /signalr/connect
2020-09-26 00:50:03.6946264 /signalr/start
2020-09-26 00:50:03.7516878 /signalr/send
2020-09-26 00:50:03.7753066 /signalr/send
2020-09-26 00:51:04.1870549 /signalr/negotiate

After the first connect (WebSocket) request, we also see the following error logged - “SignalR.Transports.WebSocketTransport Error: 0 : System.Net.WebSockets.WebSocketException (0x80070026): Reached the end of the file”.

After that we receive the second connect (SSE). We found the connect request for SSE transport has the HTTP connection header value of “close”.

94% connections are using WebSocket transport. 5% connections are using SSE transport and having the above issue.

What could be causing the transport to transition from WebSocket to SSE?
Why is SSE transport breaking at regular intervals of 1 minute and then connecting again?

iis
signalr
signalr-hub
server-sent-events
asked on Stack Overflow Sep 26, 2020 by Manish Garg • edited Sep 26, 2020 by Daniel A. White

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0