Write
the following program in C/C++ or any other language:
NAME
GMC - Group Multicast Chat
SYNOPSIS
GMC <multicast-address> <port-number>
DESCRIPTION
·
The program creates a single UDP socket U:
The socket joins the multicast group G defined by the
two arguments:
<multicast-address> <port-number>
e.g., 224.0.0.1 10123
·
The socket U is used to send/receive two types of multicast
messages:
1.
Heartbeat
Messages: sent periodically (e.g., every 5 seconds) to G, indicating it is alive.
2.
Chat Messages: typed be the user at the keyboard and sent to G.
·
When the socket
receives these two types of messages it reacts as follows:
1.
Heartbeat
Messages: are used to update a group membership
list L.
Each
member in L has a unique identity I given by the
unique pair:
<Host
Name> <Sender Process ID>
e.g.,
vega.cs.odu.edu 7893
Whenever
a new member is added/deleted, the program
displays the information I
of the added/deleted member and then
displays the updated list L.
2.
Chat Messages: are displayed to the TTY preceded by the sender’s identity I.
·
When the user types:
§ CTRL-C the program displays the list L.
§ CTRL-D the program Exits.
·
The following figure is an illustration of the
program description:

·
The program utilizes the multicast
examples and uses the UNIX Signals.
·
You may test the Example implementation at:
http://www.cs.odu.edu/~cs779/spring11/assignments/a1/wahab/
Enter the following
command on some of the fast machines,
e.g., vega, antares, capella and procyon.
% GMC 224.0.0.1 10123