Avatar of josgood
josgoodFlag for United States of America

asked on 

Socket connection actively refused

I'm new to socket programming.  I have
         Socket socket = new Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);
         IPHostEntry host = Dns.GetHostEntry("localhost");
         IPEndPoint endPoint = new IPEndPoint(host.AddressList[0],8080);
         socket.Connect(endPoint);
The Connect call fails with "No connection could be made because the target machine actively refused it".

The debugger says host.AddressList[0] is 127.0.0.1.

I'm running Windows XP Media Center Edition Version 2002 SP2.  I have ZoneAlarm installed, with trusted zone security turned off.  I have the same problem if I shut it down.  Windows Firewall is turned off.

I probably need to turn off some protection or enable port 8080 somewhere, but I don't know where to look.

I appreciate your help.
C#

Avatar of undefined
Last Comment
josgood
Avatar of josgood
josgood
Flag of United States of America image

ASKER

Increased point value
ASKER CERTIFIED SOLUTION
Avatar of RichardJFoster
RichardJFoster

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of josgood
josgood
Flag of United States of America image

ASKER

Thank you _very_ much!  

Thank you for taking the time to think of where a beginner could have gone wrong and then providing example code.  I really appreciate it.

Your answer was exemplary.
C#
C#

C# is an object-oriented programming language created in conjunction with Microsoft’s .NET framework. Compilation is usually done into the Microsoft Intermediate Language (MSIL), which is then JIT-compiled to native code (and cached) during execution in the Common Language Runtime (CLR).

98K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo