<?xml-stylesheet type="text/xsl" href="https://uat.community.rws.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:2660.</title><link>/product-groups/tridion/tridion-sites/b/techweblog/posts/tcp-error-code-10061-no-connection-could-be-made-because-the-target-machine-actively-refused-it-127-0-0-1-2660</link><description>When we try implement SDL Web, for most of the existing audience in this community, this error code might seem familiar, but for new bees in the community or for people who are new to SDL Web, this error code is something new and they can’t understand</description><dc:language>en-US</dc:language><generator>Telligent Community 12 Non-Production</generator><item><title>RE: TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:2660.</title><link>https://uat.community.rws.com/product-groups/tridion/tridion-sites/b/techweblog/posts/tcp-error-code-10061-no-connection-could-be-made-because-the-target-machine-actively-refused-it-127-0-0-1-2660</link><pubDate>Fri, 29 May 2020 10:43:02 GMT</pubDate><guid isPermaLink="false">10acfa76-f078-475b-a7ef-fc5b3e8d2934:d40ee761-bea1-4477-bb35-2053b78307b0</guid><dc:creator>danel young</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;This exception message says you&amp;#39;re trying to connect to the same host ( 127.0.0.1 ), while you&amp;#39;re stating that your server is running on a different host. This 127.0.0.1 represents a &amp;#39;loopback&amp;#39; . It allows the computer to communicate with itself via network protocol .&lt;/p&gt;
&lt;p&gt;Dns.GetHostEntry(IPAddress.Loopback).HostName returns the host name of your machine. When you pass a host name to TcpClient , it will resolve it to one or more IP addresses using Dns.GetHostAddresses(hostName) . This includes the public and local IP addresses of your machine (e.g. 192.168.12.10), but not 127.0.0.1 (loopback address). So your client is trying to connect to any of the non-loopback addresses of your machine, while your server is listening only on the loopback address . So, &lt;a href="http://csharp.net-informations.com/communications/connection.htm"&gt;no connection&lt;/a&gt; can be established. The solution to this problem is that connect to the same end point your server is listening on.&lt;/p&gt;&lt;img src="https://uat.community.rws.com/aggbug?PostID=7105&amp;AppID=95&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>