I have a website that accesses an API. when I run it on my localhost it works fine.
but when I publish on the server I get an error.
Unable to connect to the remote server System.Net.Sockets.SocketException (0x80004005):
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 10.10.9.108:50300
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket,
IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
A SocketException is thrown by the Socket and Dns classes when an error occurs with the network. Most of the time these are connectivity issues due to different IP protocols (IPV4/IPV6) between the two server/computers trying to communicate or extra authentication
rules setup on one of the computers for in/out connectivity. Ways to troubleshoot this
SocketException are, check you have proper internet connection is there on your machine or not, and you are able to ping the remote server or not. Possible causes for the error:
I have creating windows service for accessing soap and trying to access but it is giving below error. I have also done the given changes but still I am facing same issue
Correlation ID - ListRequestforSubmitResponseClient = processSubmitDocumentCalling : System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: 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 10.700.52.345:443
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
None
0 Points
2 Posts
System.Net.Sockets.SocketException
Feb 23, 2019 05:43 AM|akbarAzan|LINK
I have a website that accesses an API. when I run it on my localhost it works fine.
but when I publish on the server I get an error.
Unable to connect to the remote server System.Net.Sockets.SocketException (0x80004005):
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 10.10.9.108:50300
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket,
IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
Asking you for your advice.
Thank you,
Contributor
3500 Points
1300 Posts
Re: System.Net.Sockets.SocketException
Feb 25, 2019 03:26 AM|Ackerly Xu|LINK
Hi akbarAzan,
It seems your service is trying to respond to 10.10.9.108:50300 .
Are you sure it is an external ip address instead of an internal ip address?
If it is an internal address , it couldn't connect to internet.
Please configure your website's ip address.
https://manage.accuwebhosting.com/knowledgebase/2886/How-to-configure-IIS-to-access-website-using-IP-address.html
Also please check whether your website has firewall or proxy.
https://social.technet.microsoft.com/Forums/en-US/d012a289-b728-42d1-a40f-7555159b52b2/error-a-connection-attempt-failed-because-the-connected-party-did-not-properly-respond-after-a?forum=WAVirtualMachinesVirtualNetwork
To disable proxy, you could write below code in web.config.
Best regards,
Ackerly Xu
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
None
0 Points
2 Posts
Re: System.Net.Sockets.SocketException
Feb 25, 2019 05:06 AM|akbarAzan|LINK
None
0 Points
14 Posts
Re: System.Net.Sockets.SocketException
Jun 03, 2020 05:02 AM|EvanChatter|LINK
A SocketException is thrown by the Socket and Dns classes when an error occurs with the network. Most of the time these are connectivity issues due to different IP protocols (IPV4/IPV6) between the two server/computers trying to communicate or extra authentication rules setup on one of the computers for in/out connectivity. Ways to troubleshoot this SocketException are, check you have proper internet connection is there on your machine or not, and you are able to ping the remote server or not. Possible causes for the error:
None
0 Points
1 Post
Re: System.Net.Sockets.SocketException
Oct 09, 2020 08:30 AM|sangamp|LINK
I have creating windows service for accessing soap and trying to access but it is giving below error. I have also done the given changes but still I am facing same issue
Correlation ID - ListRequestforSubmitResponseClient = processSubmitDocumentCalling : System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: 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 10.700.52.345:443
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)