Appreciate this info.
How would this loopback adapter be done?
Main Topics
Browse All TopicsI'm trying to create a bare-bones socket application. I'm using the following code from MSDN to see how the connection is made etc, etc. Using the code from the snippet below, I get the following error:
No connection could be made because the target machine actively refused it
The error appears on the line with asteriks. Although I'm connected to a LAN and the Internet, I'm assuming this is all being attempted on my own machine. The IP and port provided by the error message is indeed my machine.
Thanks!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I'm using XP and I went through the Add Hardware wizard and installed the loopback adapter. Then I rebooted but got the same thing.
Tell me, when these lines are executed:
Dim ipAddress As IPAddress = ipHostInfo.AddressList(0)
Dim remoteEP As New IPEndPoint(ipAddress, port)
What's going on with the IPEndPoint? This is where I should establish the endpoint - right? Should I hardcode my own IP ?
Also, you can see by the picture below that my new 2nd network connection isn't looking good.
Thanks!
>> So, to put it another way, any computer that you sit down at can be though of as 127.0.0.1
Ok, I'm with you on that.
Since I enabled the loopback hardware, my computer now has two network cards per say. This new, second network adapter has received a new IP address through DHCP but apparently it is only partially configured. That is, it does not have a default gateway. Also, my primary adapter starts with '192'... but the loop back virtual network card shows a number starting with '169'...
I see this using the IPCONFIG command and the adapter is identified by the words 'Connection 2'. I would think the IPCONFIG command would have shown an address of 127.0.0.1 - what's up with that? This is supposed to be the loopback network card and it shows something other than 127.0.0.1
I tried to hard code the 127.0.0.1 in the IP properties but it wouldn't allow me saying, " this IP is reserved for loopback purposes only. Pick another number starting with ..."
Thus, there must be some other step of configuration I'm leaving out - yes/no?
Thanks!
Yeah, you can completely uninstall the loopback adapter if 127.0.0.1 works in your code.
Go to the command prompt an ping 127.0.0.1, it will already be live... You can also use 'localhost', which resolves internally in the system to 127.0.0.1
The loopback adapter is a hardware representation of a loopback which allows you to configure some other IP address as the address, but it is in addition to localhost.
>> uninstall the loopback adapter if 127.0.0.1 works in your code.
No, I haven't got anything to work yet.
>> Go to the command prompt an ping 127.0.0.1
Yes, I get a reply but something still isn't right if I consider the 2nd adapter's icon in the tray (see the picture)
>> You can also use 'localhost', which resolves internally in the system to 127.0.0.1
To put it yet another way, the call to
Dns.GetHostEntry(Dns.GetHo
... is supposed to also obtain the local host IP - right? But for some reason, the attempt to obtain an end-point of my local address is failing. Look again at these lines of code from the snippet in my first post:
' Establish the remote endpoint for the socket.
' For this example use local machine.
Dim ipHostInfo As IPHostEntry = Dns.GetHostEntry(Dns.GetHo
Dim ipAddress As IPAddress = ipHostInfo.AddressList(0)
Dim remoteEP As New IPEndPoint(ipAddress, port)
Yet when the code hits this line:
' Complete the connection.
client.EndConnect(ar) **************************
It doesn't like the value of 'ar' -- and gives the following error:
No connection could be made because the target machine actively refused it IP # 192.... : 11000
As we talked about earlier, I made an exception for this port in the firewall but still the same thing.
Any ideas?? Thanks!
Forget about the loopback adapter for a moment... :-), It is *not* necessary if you can use the machines internal loopback IP address... Have you tried?
' Establish the remote endpoint for the socket.
' For this example use local machine.
Dim localHost() As Byte = {127, 0, 0, 1}
Dim ipAddress As New IPAddress(localHost)
Dim remoteEP As New IPEndPoint(ipAddress, port)
>> Forget about the loopback adapter for a moment
Surely. I disabled that adapter so my machine would certainly now be using the one true adapter.
I ran the program with the code you provided. However, I got the same error except it now read like this:
No connection could be made because the target machine actively refused it IP # 127.0.0.1 : 11000
What do you think?
Looks like I'm forced to use an offline computer on this one. I can't fool with these Trend Micro settings.
Thanks a lot for you help on this! If you get bored, I have another one dealing with sockets that isn't getting any action.
http://www.experts-exchang
The code is all right there from a sample project, I was looking for some help interpreting it.
John
Business Accounts
Answer for Membership
by: ladarlingPosted on 2009-09-03 at 12:35:15ID: 25254145
You probably need to unblock port 11000 in the windows firewall. Failing that, you may need to install a loopback adapter.
http://support.mic rosoft.com /kb/839013