Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Javatutorials Multicasting in Java - java tutorials,tutorial

Related Tutorials


 
 

Share on Google+Share on Google+

Multicasting in Java - java tutorials,tutorial

Advertisement
multicasting in java

Multicasting in Java

In a datagram network, Multicast is the transmission of the data packet to the multiple destination. The advantage of multicast is that you can send down its data to a group of hosts sharing a common address. If we are not using Multicast, then we need to send the data packets one for each host.

Sending Multicast datagrams

In order to send any kind of datagram in Java, be it unicast, broadcast or multicast, one needs a java.net.DatagramSocket :

DatagramSocket socket = new DatagramSocket();

The word "Multicast" is typically used to refer to IP Multicast, which is a protocol for efficiently sending to multiple receivers at the same time on TCP/IP networks, by use of a multicast address.

One can optionally supply a local port to the DatagramSocket constructor to which the socket must bind. This is only necessary if one needs other parties to be able to reach us at a specific port. A third constructor takes the local port AND the local IP address to which to bind. This is used (rarely) with multi-homed hosts where it is important on which network adapter the traffic is received.

For more details Click the link below :

Multicast in Java

UDP Multicast Client in Java

Multicast Server in Java

 

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: April 18, 2011

Related Tutorials

Discuss: Multicasting in Java - java tutorials,tutorial  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:1
ayo
April 10, 2012
how to connect tcp/ip to multicast(udp)

i am have a challenge on how to connect tcp/ip to multicast(udp). i am working on a network pong game. i thought if i can have a multicast that can broadcast without ipaddress and communicate with a tcp/ip it will be awesome. thanx.
DMCA.com