WebSocket Waiting for readyState = 1 Persists

0
0

Hello,

I have a web app developed in VB.net which I recently deployed to an Azure server.  On the web, the app functions fine but is a bit slower compared to the IDE.  When using the pdfViewer to display a long report it runs a long time and the connection resets.  Smaller reports are fine.  I set “validateClient”: false in the Default.json and it didn’t help.

I noticed that the  WebSocket Waiting for readyState = 1 notice persists.  I double checked that my Web App on the server was configured for WebSocket.  I added “enableWebSocket”: true in the default.json, knowing this was the default, but this didn’t work.  I suspect websocket would help with speed and long functions but I must be missing something to enable it.

I used this for authentication:

If System.Security.Claims.ClaimsPrincipal.Current.Identity.IsAuthenticated = True Then
    Application.Session.UserEmail = System.Security.Claims.ClaimsPrincipal.Current.Identity.Name
   Console.WriteLine(Application.Session.UserEmail)
End If

I only need the email address since my app internally authenticates the user.

Any tips on enabling websocket functionality would be very much appreciated.

Thanks!

Gerry

 

 

  • You must to post comments
0
0

Hi Alaa,

Thanks for the quick response!  I guess I was hoping I had found out why the pdfViewer was running so long loading thus resetting the connection and how I could get a more responsive interaction overall.

I had already found the guide you sent.  My App Service shows Websocket is enabled.  I’m not using a VM.

Inside the app after the program.vb and on the first loaded page I inserted this code to find out if websocket was enabled:

If Application.IsWebSocket = True Then
     MessageBox.Show(“Websocket is ON”)
Else
     MessageBox.Show(“Websocket is OFF”)
End If

It always shows OFF.  I don’t know if there’s a better place to insert this code to check.

I assumed  “WebSocket Waiting for readyState = 1” meant it was still waiting.  It never displays a different notice.

If websocket is working, I guess I need to work on how the pdf file is loaded into pdfViewer.  Any thought would be appreciated, but it looks fairly straightforward and works fine in the DE.

Thanks much!

Gerry

 

  • You must to post comments
0
0

Hi Gerald,

If the application is deployed to an Azure VM, then you should enable WebSockets from IIS, it’s not on by default and it needs to be installed as a separate feature if you’re using Windows Server.

And, if you’re using an App Service plan, you can follow this guide to enable it.

But, from what I understood WebSocket is already enabled, if you don’t see any errors related to a connection to a websocket endpoint you should be good to go!

The “WebSocket Waiting for readyState = 1” means that the connection was established!

Best Regards,
Alaa

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.