I developed a console application that is stored as a web service.
In this console, I host a self-hosted web app service. Also, I open a thread that opens a web socket with another program (HTTP, port 443).... Now, when I initialize the web service, I can reach the self-hosted service, and the web socket works well. Now after 2-3 hours the web socket is closed and this is the exception that i get:
"An established connection was aborted by the software in your host
machine".
Also, I get the following error:
"Exception: Error message: Socket not connected"
..
Has anyone an idea for this?
Have you tried turning your firewall off just to make sure? Also make sure that HttpWebRequest.KeepAlive is turned on
Related
I am making a Winforms app that must connect to a ASP.NET WebApi web service that I also made. When I connect to the web service from my computer the Winforms app works, but when I install the Winforms app on some computers it fails to connect to the web service with the following exception:
System.IO.IOException: Can not write data to the transport connection:
The interruption of an existing connection has been forced by the
remote host
The problem is that this error might be due to a connection error or due to bugs in either the Winforms app or the web service and I have no idea what might be the cause. I can connect to the server where the web service is hosted. Are there any server logs that I can use to see what might be the cause of this error and if there are, where do I check them?
Am facing a weird issue ... we have multiple services application (separate VS solution altogether) and they communicate with other.
WCF service application consumes the WEB API service. All this services been deployed locally in IIS.
While testing I found that, WCF service app failing with below error
Error occurred while getting response System.Net.WebException: The
underlying connection was closed: An unexpected error occurred on a
send. ---> System.IO.IOException: Unable to read data from the
transport connection: An existing connection was forcibly closed by
the remote host. ---> System.Net.Sockets.SocketException: An existing
connection was forcibly closed by the remote host
The same works fine for my other team mates (with exact same application settings and IIS settings) in their local environment but for my case it's failing.
Did searched over internet and tried few of them but no luck (few suggested Firewall issue, which can't be since it's in local machine and moreover Firewall service is disabled).
I did put a break point by attaching the w3wp worker process and tried to debug and found that the call to WEB API service is not happening at all; means my break point to WEB API projects Application_start() doesn't hits at all.
Also yes (as asked by #Developer in comment) another strange stuff is that I can hit the WEB API from Browser or LinqPad and it works like a charm. Problem comes only when calling through WCF application code.
Any idea how can I solve this mess. Please suggests.
I've wrote a web application that is also listening to a net tcp port.
the client of this web application is connecting via a plain tcp connection and everything is working great but the issue is that the IIS is stopping my site after some inactive time.
The issue is that the web application is initializing the tcp connection and any new connection is coming directly to the TCP connection without being hosted by the site.
I'm not sure how this should be solved.
found exactly the post that nailed it!
https://weblog.west-wind.com/posts/2013/oct/02/use-iis-application-initialization-for-keeping-aspnet-apps-alive
in general it specify that the application pool should be set to always running and the site should host the service at the pre load event that should be configured and implemented.
I created wcf service library with duplex communication and hosting using windows service, and one more project for clinet i.e, inside windows service I added wcf service reference and trying to consume service. when I try to call wcf service callback method I m getting "The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:00:59.9390000'".
This error I m getting when I try to consume wcf service from remote system within the network.From same sytem I am able to access the service callback flow.
I tried increasing service timeout and MaxBufferSize, MaxBufferPoolSize, MaxReceivedMessageSize, MaxArrayLength sizes also, but no luck. Icreated sample service and client n uploaded in below link.
Sample Applications link
App1 :- WCFService(winhosting).zip: consists of two pojects one is wcf service library project with callbacks and second project is windows service to hosting wcf service
App2 :- WCFClient(WinService) (2).zip : consists of one project i.e, windows service added wcf service reference here.
I haven't looked at the downloads yet but you sound like you've looked around a good bit so the only thing I can think of is that you run your service as administrator. This was my problem, it would not send the packets and I got the same error as you, all due to the service not running as administrator. Right click your service -> Properties -> Log On -> Make sure you tick "This account" and then type in the administrator credentials and try it :)
I get the following error on my asp.net website, while trying to invoke a wcf service method:
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 77.XXX.XX.XX:809
And then more in detail, I get a socketexception, webexception and also this endpointnotfoundexception:
There was no endpoint listening at
http://77.XXX.XX.XX:809/RemoteSyncService/ that could accept the
message. This is often caused by an incorrect address or SOAP action.
The wcf service (RemoteSyncService) is hosted in a .net application on the 77.XXX.XX.XX server. The binding used is basicHttpBinding.
The endpoint address, used in the asp.net site web.config is:
http://77.XXX.XX.XXX:809/RemoteSyncService
// this is the same on the remote server
The service code for the asp.net website was automatically generated, by using the 'add service reference' feature in VS2010 (on this address: http://77.XXX.XX.XXX:809/RemoteSyncService/mexHttp, as described in the other remote server).
All works perfectly on the dev machine..
What I tried and works:
running/debugging the asp.net locally, and invoking methods
trying to contact the wcf service with wcf test client
the asp.net site can contact the other server, because a ftp transfer from my asp.net site to the remote server was successful
pinging the remote server
Will provide code if needed..
make sure your production server isn't firewalling you.