aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes udp sockets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "udp sockets" Watch "udp sockets" New topic
Author

udp sockets

naval joshi
Greenhorn

Joined: Jan 05, 2011
Posts: 8

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


scjp 6 , Adobe certified flex developer
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19784
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
naval joshi
Greenhorn

Joined: Jan 05, 2011
Posts: 8

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...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: udp sockets