CS476/576

Assignment #3

Due Midnight, Wednesday   Nov 17, 2010


Write a C/UNIX/TCP-Socket program with the following descriptions:

NAME

rcg -  creates a graph of  randomly tcp-socket-connected processes.

 

 

SYNOPSIS

 

        rcg   [n]

 

 

DESCRIPTION

The program creates a  graph of n processes each having its own xterm. 

The default value of n is 4.

 

Each process:

·       Is randomly connected to a subset of other process via a tcp connection.

The process accepts connections from any process and randomly connects to at most one other process that is not already connected to it.

·       Reads lines from stdin , writes it to all other directly connected processes using the tcp connections.

·       Displays the received lines to the stdout.

·       Upon typing CTRL-D  at any xterm, the process and all other directly connected processes terminates.


 My implementation is under:

/home/cs476/public_html/fall10/assignments/a3/wahab/rcg