Mehmet Nuri Tike
1250810

	CENG532 - HW#1

--------------PARTI--- Done Using Linux IPC (Message Queues)

Source file name: votingIPC.c

compilation	:
	gcc -o votingIPC votingIPC.c

compiles&runs 	: linux machines (inekxx machines in our department for example)

usage		: 
	votingIPC <number of engineers> <name of this engineer> <age of this engineer>

	when all the programs (number of engineers) run on the same machine,
	with the same command, screen output will do the rest.  

	example:	votingIPC 3 osman 22

special notes	: 
	- all of this part is implemented
	- <name of this engineer> parameter must a connected (no empty spaces
	  or line breaks) string of length 30 max.
	- before the program is run, be sure that source file: votingIPC.c
	  exists in the same directory with executable. It is necessary
	  for ftok() function to produce the same unique message queue 
	  identifier by all proceses.
	- voting is done automatically through giving random votes by processes.


--------------PARTII--- Done Using Linux Sockets

Source file name: votingSocket.c

compilation	:
	gcc -o votingSocket votingSocket.c -lpthread

compiles&runs 	: linux machines (inekxx machines in our department for example)

usage		: 
	Processes must be run on different machines. One process must start as
	server before the others. Then remaining processes can be started as
	normal client. After all other clients subscribe to the server, server
	will also become a normal client and continue its execution. So, total
	number of processes is equal to number of engineers (no extra process 
	for the server).

	To start the server process:
	votingSocket <name of this eng.> <age of this eng.> -s <# of engineers>
	
	Example : votingSocket osman 22 -s 3



	To start the client processes:
	votingSocket <name of this eng.> <age of this eng.> -c <server machine name>
 	
	Example: votingSocket ali 25 -c inek29.ceng.metu.edu.tr

	
	After server and clients started properly, screen output will guide the
	rest.


special notes	: 
	- all of this part is implemented
	- Architectire is decentralized. After subscribing to server and 
	  personal and address information from server, all clients (even 
	  server) connect to the others and there remains no server 
	  functionality.
	- <name of this engineer> parameter must a connected (no empty spaces
	  or line breaks) string of length 30 max.
	- <server machine name> parameter must be the name of the machine on
	  which server processes is run formerly. It is not the IP address.
	  See example.
	- All processes must be on different machines, otherwise processes on 
	  the same machine will listen on the same address and same port, and
	  adress conflicts will occur.
	- voting is done automatically through giving random votes by processes.
