Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 129241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:45:38+00:00 2026-05-11T05:45:38+00:00

I’m working on a simple hello world TCP/IP client server app in C# and

  • 0

I’m working on a simple hello world TCP/IP client server app in C# and am unable to get my client to connect. Can anyone offer any additional troubleshooting steps? I’m starting to run out of ideas…

Here are the relevant sections of code:

server:

Console.Out.WriteLine('About to bind address'); IPAddress ipAd = IPAddress.Parse('127.0.0.1');  Console.Out.WriteLine('Choose a port to bind...');  String port = Console.In.ReadLine(); int iPort = Int32.Parse(port);  TcpListener myList = new TcpListener(ipAd, iPort);  myList.Start();  Console.WriteLine('The server is running at: '+myList.LocalEndpoint); Console.WriteLine('Waiting for a connection.....');  Socket s = myList.AcceptSocket(); Console.WriteLine('Connection accepted from ' + s.RemoteEndPoint); 

client:

Console.Out.WriteLine('enter address: '); string address = Console.In.ReadLine(); Console.Out.WriteLine('enter port: '); int port = Convert.ToInt32(Console.In.ReadLine());  TcpClient tcpclnt = new TcpClient(); Console.WriteLine('Connecting.....');  Console.Out.WriteLine('Address: ' + address + ':' + port); tcpclnt.Connect(address, port); 

I am able to ping the server from the client machine, however I am unable to telnet to the server using the bound port. I’ve tried a variety of ports (a few in the low 8000s and a few up around 40000). I have disable windows firewall on both systems. The systems are connected to a router which is not on the internet. I’ve tried with and without port forwarding set to forward incoming requests on the given port to the server machine with no effect.

The only exception that I’ve been able to trap is thrown by the client:

No connection could be made because the target machine actively refuses it.

I checked for an InnerException but it seems that there are none – that is the base exception. Could that be right?

Not sure what else I should be looking at – any additional troubleshooting steps would be helpful.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T05:45:39+00:00Added an answer on May 11, 2026 at 5:45 am

    The code above is listening to request coming from the loopback address. This will effectively only listen to connection on that network, and that network only includes your machine.

    Have you tried listening to the address bound to the network from which the connection should be coming? On a local network it should be something like 192.168.x.x or 10.x.x.x

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.