Web Socket Connection closed with status code 1006 (SignalR) - push-notification

I am using signalR alongwith quartz in my asp .net core 2.1 web application. App is running perfect on localhost.Bu getting an error on mostly machines which is "WebSocket closed with status code: 1006 ()". Connection to signalR automatically lost and established again on refresh the page.

Related

IIS with secure socket connection keeps responding after stopping website

I'm running IIS 10.0 on Windows Server 2019 Standard a simple ASP.NET Framework 4.7.2 with long running Websocket connection and SignalR.
Things work well when it comes to stopping the website and sockets are closed if I'm using non secured sockets. However if I have a secure socket connection (TLS/SSL) the worker process will hang as long as the sockets are open. The client will continue to send and receive responses from the server. The only way to fix this is to have the client restart the connection.
Both direct websockets or via SignalR will cause this issue, the application will keep on running after trying to stop the website, transmitting and receiving messages over the secure socket; as soon as the socket closes the worker process dies as expected.
Here is a similar issue with no response : Server keeps sending ping messages to client after IIS site is stopped.
Connections do not timeout after the app pool timeout (90s)
Here is a screenshot of the active connections
What could be causing this and how do I make sure these connections are dropped when a stop/recycle is requested by IIS ?
Update:
If I change the port but still use a secure connection, the problem goes away. On website stop, the connections are dropped and the worker process dies as expected. So it seems to have something to do with port 443...

RSocket controller sending Reactor Flux message to IIS hosted signalR client but nothing is received

In a dev environment a local IIS and signalR client web app creates a session with a spring boot RSocket server, and message flow is working fine.
After deployment to another server and a fresh IIS install, the signalR client can send messages to the server, creating a session from IIS port 6060 to server configured port, X (instead of 8082).
However, after the spring boot reactor Flux sends messages on port X back to the signalR client the messages are not being received by the client.
It's as if the IIS and signalR can fire and forget a send message to port X but not get a session that the port X can reply on.
Can anyone shed light on what's happening?
With a fresh install of the IIS <-> SignalR <-> RSockets <-> WebFlux messaging stack on another demo server and the same error appeared to happen. Though did not run TCP packet captures to check the send / receive message situation with Wireshark.
First of all per SignalR .Net Core 3.1 Web Application not working on local IIS the IIS WebSockets feature was not switched on.
Then, per SignalR 2.2 returns 404 Not Found on IIS 8.5 the requests to the server returned 404 errors. A / was discovered in a JSON date String in urlAPI was causing call to
using (_myStream = new StreamReader(await client.GetStreamAsync(urlAPI)))
to find another endpoint in the urlAPI that did not exist, producing HTTP 404 errors. So that was due to malformed URL.

SignalR not working in Windows Serrver R2 2012

I tried a sample app using signalR as per the below guide..
https://learn.microsoft.com/en-us/aspnet/core/tutorials/signalr?view=aspnetcore-3.1&tabs=visual-studio
The sample app works fine in local machine and even in DEV server .
UAT server it is not working .
UAT server configuration
OS: Windows server R2 2012
IIS version : 8.5
Application :Dot net
Framework : Asp . net core 2.0
Issue :
The signal demo app is working in visual studio .When i hosted to IIS . it is not working .The issue i am facing is the following :
signalr.js:3082 [2020-08-31T07:17:32.162Z] Error: Connection disconnected with error 'Error: Server timeout elapsed without receiving a message from the server.'.
Chat.js:19 Error: Server timeout elapsed without receiving a message from the server.
console error screenshot:
enter image description here
I have enabled Web socket protocol in add feature menu.
Did i missing any thing? For some reason it couldn't able to connect to the hub.
You can try to increase Javascript client timeout.
hubConnection.serverTimeoutInMilliseconds = 100000; // 100 second
If signalR got disconnected, you should try re-establishing the connection again. The connection could drop for several other reasons, including the user switching networks. For example if the user is using a cell-phone and connected to the home/office wifi but steps out which then connects to cellular data connection.
You can also refer to below links of a similar case with the issue:
How to increase timeout setting in ASP.NET Core SignalR v2.1?

Cannot Add Service Reference after the service moved to TLS 1.2

While adding service reference for a web service on Windows server 2008 R2, I am facing following error:
"The underlying connection was closed: An unexpected error occurred on a send. Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."
This web service recently moved to TLS 1.2 and does not supports below versions of TLS.
Also I am able to Add Service Reference on my local machine using VS 2010 and .net framework 4.0

Long polling with IIS 7.5

I have a ASP.NET 3.5 web application that uses long polling for chat. It long polls an asynchronous handler for new messages. Each request can last a maximum of 15 seconds before being closed and reconnected.
The application runs fine using Visual Studio Built-in web server but once deployed to the IIS (i.e. IIS 7.5 ) the long polling requests start getting aborted after i login around 10 users.
Please help.

Resources