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 8900953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:13:44+00:00 2026-06-15T01:13:44+00:00

I have two programs use to communicate with each other via UDP protocol (client

  • 0

I have two programs use to communicate with each other via UDP protocol (client and server), but when the client connects to the server using the method Connect (
string hostname,
int port
), Nothing happened.
This is code:

                udpclient.Connect("asuspc",6500);
            string duongdan = tbduongdan.Text;
            Byte[] sendbyte = Encoding.ASCII.GetBytes(duongdan);
            udpclient.Send(sendbyte, sendbyte.Length);

“asuspc” is name of computer that i intend to connect.
After a while to find out, I know that the hostname is “The DNS name of the remote host” rather than the name of computer, then what is “The DNS name of the remote host”?How to know “The DNS name of the remote host” of a computer?

  • 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-06-15T01:13:46+00:00Added an answer on June 15, 2026 at 1:13 am

    By definition, UDP is a connection-less protocol. You do not need to connect in order to send/receive data.

    Note that calling Connect() on a UdpClient object does nothing other than setting a default remote host so that you won’t have to specify it each time you use the Send method. So don’t expect anything to “happen” after the client calls the Connect method.

    With that out of the way, if both your server and your client are on your private LAN, why don’t you use the computer’s IP? e.g.

    // replace 192.168.1.44 with the server's private IP
    udpclient.Connect("192.168.1.44",6500);
    string duongdan = tbduongdan.Text;
    Byte[] sendbyte = Encoding.ASCII.GetBytes(duongdan);
    udpclient.Send(sendbyte, sendbyte.Length);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have client and server programs which now communicate via TCP. I'm trying out
I have two begininer programs, both using the 'while' function, one works correctly, and
I'm going to have two independent programs (using SqlAlchemy / ORM / Declarative) that
I have two very similar programs each trying to run two threads OddThread and
I've got a table recording views of programs. Each program can have two different
I have written a server and a client both as separate apps. They communicate
I've written a two short programs that use anonymous pipes to communicate. The parent
I have two simple programs that use named pipes, here is the first: int
I have two programs written in C++ that use Winsock. They both accept TCP
I am making a program for school in which two programs communicate with each

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.