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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:43:01+00:00 2026-06-04T07:43:01+00:00

Can any one guide me a simple design or idea or common steps to

  • 0

Can any one guide me a simple design or idea or common steps to implement UDP Chat server and Client?i am not asking cord ,i want to try my self.I am looking for a programming language independent explanation.

Thanks in advance

  • 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-04T07:43:02+00:00Added an answer on June 4, 2026 at 7:43 am

    The classic design is, whenever a user types a line of text into his chat-client, that client puts the text (and possibly some other info, such as the user’s name) into a UDP packet which it sends to the server. The server receives the UDP packet, and then forwards copies of the packet onwards to all of the other clients it knows about. When the other clients receive the forwarded packet, they each display the packet’s contents for their local user to read.

    The only non-obvious part is discovery — i.e. how does a client know which IP address to send the UDP packets to, and how does the server know which IP addresses to forward received packets on to?

    If you can guarantee that all the clients will always be on the same Ethernet LAN as the server, then this is easy to handle — just always send all UDP packets to the broadcast address (255.255.255.255), and everyone on the LAN will receive them. (In fact, in this scenario you don’t need a server at all, as the clients can communicate with each other directly).

    In the more realistic case where clients are located at arbitrary locations on the Internet, discovery gets a bit more difficult. Hopefully you can run the server at a well-known, fixed location (e.g. http://www.thabo-chat.com or something) and just hard-code that hostname into the clients. Then whenever a client starts up, it can send a UDP packet to the server to let the server know that it exists, and the server can read the source IP address from the received UDP packet and add it to a list of known-client-IP-addresses that it will forward received packets to. It should also keep a timestamp of when each client was most recently heard from, and remove IP addresses from the list if they haven’t been heard from in a long time (to avoid pointlessly sending packets to clients that have since gone away).

    The last issue you’ll face when using UDP over the Internet is that a lot of computers out there are behind firewalls that will block UDP packets coming from the Internet, so the UDP packets your server sends will in many cases not arrive at the clients it was trying to send them to. There’s not a very good solution for this — you can ask your client-users to set up UDP port-forwarding on their router, but that’s a hassle for them and a lot of people don’t have the skills to do that. The only real alternative in that case is to use TCP instead, and have the clients connect to the server via TCP and send data back and forth that way instead (that way works because almost all firewalls allow bi-directional data traffic over outgoing TCP connections, since that is necessary for web browsing and email)

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

Sidebar

Related Questions

can any one guide me how to get parameter specially image from the given
Can any one guide how to search number with wildcard on thinking sphinx... I
Good day to all, Can some one guide me in displaying a simple post
Can any one tell me if its possible to create a stored procedure in
Can any one tell me how can i replace the slideup function with fadeout('slow')
Can any one give me the difference between Itemsource and DataContext of Listview in
I'm planning to use Netty to design a TCP Server. When the client connects,
Can anyone guide me what could be the problem in the mentioned below:- alt
Can anyone point me to a guide for creating inf files? In particular, I'm
Does anyone know of an ASP.NET guide to implementing OpenID and what information can

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.