Recent Changes - Search:

Distributed Computing

This website demonstrates using wikis as teaching and learning tool.

The course instructor is also happy to share the teaching materials here with those who find it readable.

Tutorial - Java Multicast Programming

Activity

Write a Java program called DaytimeBroadcastServer that multicasts the date and time of the local machine to a specified multicast group every five seconds.
Write another Java program called DaytimeBroadcastClient that is used to test the former program; it is able to receive packets from a specified multicast group and print the sender’s address and the contents of the packets..
You can use the following code fragment to obtain an array of bytes containing the date and time of a local machine:
String str = (new Date()).toString();
byte[] data = str.getBytes();

Questions

1. Can you create a MulticastSocket that listens and transmits on a UDP port that has been used by a DatagramSocket sitting in the same machine?
2. Is it possible to create a MulticastSocket that listens and transmits on a UDP port that has been used by other MulticastSocket sitting in the same machine?.
3. List the seven methods that add to MulticastSocket on top of DatagramSocket.
4. Which types of exception may all the methods of MulticastSocket throw?
5. In this peer-to-peer mode of a multicast chat system, can we prevent anyone from joining the multicast group? If so, how?
6. Can we modify the program so that it is able to accept UDP packets only from the pre-specified range of IP addresses? If so, how?
7. If somebody in the network knows the multicast group and the UDP port number being used by the multicast chat system, is it possible for him or her to create annoying effects, or even crash our system?
Edit - History - Print - Recent Changes - Search
Page last modified on November 11, 2007, at 07:45 PM