Is the IP source or target in this System.Net.Sockets.SocketException?

I am making an outbound connection using the DNS name on a server other than localhost and I get this exception:

System.Net.WebException: cannot connect to the remote server ---> System.Net.Sockets.SocketException: the connection could not be completed because the target machine actively refused it 127.0.0.1► 555

The text implies that the TARGET machine refused the connection, but the IP address and port are from the local host, which is confusing. Similarly, is the IP address really the outgoing IP and port, although the exception was caused because the target refused the connection? Or is this an exception to the local firewall blocking the outgoing connection?

+3
source share
2 answers

The target machine has actively refused, which means that the port you are trying to connect to is definitely closed. In this case, 5555. Try running netstat -an to check if the port is open, that is, some service is listening on the port.

And if you get a local ip, then most likely you have a dns permission error and, as you mention the firewall, which is an option.

+1
source

I have the same problem and I can say that it ONLY happens on websites running on my local IIS.

, IIS. IIS, , , .

UPDATE:

IIS .

2:

, - Proxy HttpWebRequest , . , - . request.Proxy = null , .

, -!

0

Source: https://habr.com/ru/post/1737635/


All Articles