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

  • SEARCH
  • Home
  • 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 856813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:17:47+00:00 2026-05-15T08:17:47+00:00

I am writing a simple C# tcp client and server program. The server will

  • 0

I am writing a simple C# tcp client and server program. The server will eventually be on a different machine but now I am just testing on the same machine. I am getting an exception error “Only one usage of each socket address (protocol/network address/port) is normally permitted” when I create my TcpClient using the ip address. But it works if I use “localhost” instead of ip address. I get the ip address from ipconfig. I also try having the server running on a different machine and my TcpClient gets the same exception when I specify the remote machine’s ip address. How do I make the connection using ip address? thanks.

Below is the code where I create the TcpClient

            IPAddress ipaddr = IPAddress.Parse("192.168.128.100");
            int port = 3000;


            int tries = 0;
            client = null;
            while (tries < 6) // try for 3 seconds
            {
                try
                {
                    tries++;
                    IPEndPoint ipEndpt = new IPEndPoint(ipaddr, port);
                    client = new TcpClient(ipEndpt);
                }
                catch (Exception ex)
                {
                    client = null;
                    Thread.Sleep(500);
                }
            }
  • 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. Editorial Team
    Editorial Team
    2026-05-15T08:17:48+00:00Added an answer on May 15, 2026 at 8:17 am

    when you create tcp client, are you defining a port? if so, you should not. instead, you will connect to the port of the server.

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

Sidebar

Related Questions

I am writing simple client-server program. Client send some messages to server using UDP
i'm trying to write simple tcp\ip client-server. here is server code: internal class Program
I'm writing a simple C# program and want to use an SQL server to
I wrote a simple server and client apps, where I can switch between TCP,
I am writing a simple client-server application, and looking the MSDN docs, I came
i make a simple TCP client/server in C# and i have the problem. When
Creating a simple TCP server based on examples but still do not get how
I'm writing a C/C++ client-server program under Linux. Assume a message m is to
I'm writing a TCP/IP client and I would need a "test server" to be
I'm working on a simple hello world TCP/IP client server app in C# and

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.