Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

udp sockets

 
naval joshi
Greenhorn
Posts: 8
Eclipse IDE Flex Opera
  • Mark post as helpful
  • send pies
  • 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
 
Rob Spoor
Sheriff
Pie
Posts: 20533
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • 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 Flex Opera
  • Mark post as helpful
  • send pies
  • 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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic