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?
Related
I write a windows form as a signalr server(SignalR = WebApp.Start(#"http://" + szIP + #":9000");) and a webform client as signalr client. I run both them on my computer(Windows 10). I use iPad mini1 and SAM SUNG Galaxy Tab4 connect to my computer by ip. There is no problem during the connection. I deploy the webform to Windows Server 2008 and run the windows form on Windows Server 2008. I also set the setting of firewall rules for the port 9000(TCP). But the connection bewteen windows form and webform client is not successful. The webform client always dispaly the error as below:
Error:Error during negotiation request
Does somebody know how to solve this problem?
I had solved this problem by adding json2.js and restart windows firewall service.
I'm developing an ASP.net web application.
My default page is a simple login screen.
I am using Visual Studio to develop the application.
It will run using Visual Studio and when the data is entered to the text boxes and the button is clicked, it sends the request to my own server running Windows Server 2012 with SQL Server 2014 installed.
I will also mention that the ASP application is being created as a secondary application for an Android application. The Android application is using the same database over Internet connection so I know that the server and SQL server both can accept read and write calls.
I have tested the ASP application using WebClient calls to php files which connect to the database (this works on Android) and also OracleClient and SQLClient calls all of which work from Visual Studio on my workstation to the server machine. These all work fine to send and receive data from the database.
The problem is once I deploy the application to my hosting site the calls no longer seem to work. The default login page opens but after attempting to login I receive errors as follows:
Exception Details: System.ComponentModel.Win32Exception: No connection could be made because the target machine actively refused it
[Win32Exception (0x80004005): No connection could be made because the target machine actively refused it]
[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible.
Can anyone help me with this?
It sounds like your database is accepting connections from some clients, but not your hosting server. I would try testing a SQL connection straight from the hosting Server and see if a test connection can be successful. If you can get that to work it should work from the web server.
This article Quick ways to test OLE DB Connection String on creating a empty TestConnection.udl file will be helpful. It is easier to try different connection string settings through the Data Link Properties UI. When you save the file, you can see the connection string if you open it in a text editor (assuming it is successful).
If it's not a problem with he connection string, check that you do not have a firewall blocking connections between the Windows 2012 and SQL servers. It could be the widows firewall on either machine, or another firewall at the network level.
I got 2 servers with two equal wcf services hosted on them and one client application server. I can connect to endpoints and send a requests to both services using test wcf client app (.NET Web Service Studio) from my local machine successfully. But when I am trying to connect from client application server using the same test wcf client app I successfully connected only to the one wcf service server, but I have got an error when connecting to another one:
System.Net.WebException: There was an error downloading 'https://XXX/XXX?wsdl'. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it XX.XXX.XX.XXX:443
I performed netstat -an | find "443" command in command prompt on the client server and on my local machine to find out the difference and here what I have got:
1. On my local machine:
2. On the client app server:
What I already tried to do on client application server is:
- turned off firewall;
- stopped windows firewall service
- uninstalled mcafee virusscan enterprise application.
(I tried to set "prevent mass mailing worms from send mail" first, but mcafee was in foreign language that I don't understand, so I just uninstalled it)
after running command netstat -aon | findstr "443" on client application server I have got this result:
but I still got an error.
Does anybody know how to solve this issue?
Could be the problem on the wcf service server side?
The solution was predictable simple one - firewall was blocking the port,
but it's important to notice that the issue was caused by firewall on the wcf service server side, but not on client application server, which is making the request to that service.
I asked the technical support of that server, and they made firewall changes.
After that error was disappeared.
I faced the same issue and tried different ways to fix this. Nothing works. Later i found the issue which is, the application i tried to run is https and in my IIS, https binding was not created. I created binding https with the website and it works.
I have SSRS reports in my project.
All reports are working perfectly. but only one report is not working on production server
, working on local .
Error Msg;
A connection attempt failed because the connected party did not properly respond after a period of time,
or established connection failed because connected host has failed to respond.
Plz help ....no findings on this because it is working on local but gives error on server..
This is a configuration setting on the SQL server :
rt click on SQL server instance and go to properties
choose connections
change remote query timeout
I am trying to connect an ASP.NET 2.0 application hosted on a client machine to an SQL server 2000 instance which is installed on a domain controller running windows server 2003 (I appreciate this is not best practise, but it is something I cannot change). I am using SQL server authentication, not Windows authentication.
During debugging, the following error is displayed at the point the 'connection' is attempted within the web application (not on running any object within Sql Server):
"An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"
I have done some research, and have checked a variety of things:
1) I am certain the conection string is correct - in fact I built a little Windows app that uses the same connection information and connection succeeds...
2) This is limited to the web application - a windows application running on the remote client machine connects just fine using the same connection string (see 1).
3) The firewall settings on both computers do not prevent the connection (see 1).
4) I can ping the windows 2003 server (see 1)
5) The SQL Server credentials definitely have the rights to the objects needed
6) If I (temporarily) put the web application on the windows server 2003 and run it, it loads and runs fine (using a browser on a separate machine, or on the client machine I am trying to connect) - suggesting this is only an issue with a remote connection, and confirming the connectivity between the machines again, and also confirming the necessary security right of the SQL Server user.
7) I can start query analyser on the client machine and using the same SQL server credentials, can run the same queries on the target database just fine.
Stumped. Please help!
You need to go into the SQL Server Configuration Manager and make sure the Named Pipes option is turned on. It is not turned on by default when you install SQL Server.
Because of the research I did in the original question covering the ability of a windows app to connect but not the ASP.NET app to connect from the same machine, and the confirmation the web app was working on the server itself, I was convinced SQL server was set up correctly, that connectivity and firewalls were not a problem - it must have been a difference in the security credentials of the windows app versus the web app.
The windows app runs in the security credentials of the logged on windows user and authenticates using that, whereas the webapp runs in a restricted account and does not pass these credentials over when connecting to SQL server by default. I simply added to web.config, which impersonates the user account within which the web app runs, and it all worked!
Problem solved.