Win a copy of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

udp sockets

 
Greenhorn
Posts: 8
Eclipse IDE Opera Flex
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all...
i am creating basic chat application using udp sockets..i want to extend these sockets so that i cn chat with my frnd whose not in lan....can i do so...if yes how??do i need a server...
any information or links please..
thanks
 
Sheriff
Posts: 22126
114
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

naval joshi wrote:so that i cn chat with my frnd


Please UseRealWords: "can" and "friend", not "cn" and "frnd".

DatagramSocket can be used to connect to a specific machine using UDP, but for that you need to know the machine to connect to. Broadcasting is not possible, and that's a good thing - if you were able to broadcast through the Internet, then your broadcast would be sent to everyone across the world!

Please note that UDP is probably not a good idea for a chat client/server pair. UDP messages are not guaranteed to arrive at all, or in the right order. Your entire chat conversation could get messed up, with missing messages and messages arriving at random.
 
naval joshi
Greenhorn
Posts: 8
Eclipse IDE Opera Flex
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for your replyy...
what should i use to make a chat application...for both text and voice chat...
should i use tcp??
or anything else in java...
 
LOOK! OVER THERE! (yoink) your tiny ad is now my tiny ad.
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic