Skip to content

adityardesai/SocketProgramming

Repository files navigation

##WorkFlow
	a. All the servers boots up and read the corresponnding files.
	b. Each server will read the file and add the delimiters to form a string Z (involving neighbors and cost) and sends to client over TCP.
	c. The delimites used are (*) between words and (+) between lines.
	d. Once the string Z reaches the client on TCP socket, client processes the string Z to unwrap the data. 	
	e. The unwrapped data is used to form the cost matrix and form adjacency matrix.
	f. The same process is carried out for all the 4 servers.
	g. Once all the Z strings from each servers is received and unwrapped, the client forms a string G (involving neighbors and cost of all the servers) with same delimites (*) and (+) for words and lines ans sends to all the Servers using UDP.
	h. Once the server receives the UDP socket data, unwraps the data and displays the matrix on the console.
	i. At the client end, the client displays the adjacency matrix and calculates the MST Tree.
	j. For all the output message, corresponding port of sender and receiver is displayed.
	k. All the data processing, handling and management is made using pointers and array of char pointers. 

##Code files details
	a. client.c : C code to receive the data from all the 4 servers using TCP, calculate the Adjacency and Cost matrix.Send the details 			  of the topology to all the servers along with the cost matrix. Calculates the MST and the cost associated with it.
	b. client2.c : C code to receive the data from all the 4 servers using TCP, calculate the Adjacency and Cost matrix.Send the details 			  of the topology to all the servers along with the cost matrix. Calculates the MST and the cost associated with it. This 				file has sendto UDP function for B commented, so no data will be sent to serverB using UDP.
	c. serverA.c :
	d. serverB.c :
	e. serverC.c :
	f. serverD.c : All of these will read the respective files, process it and send to client using TCP. They recieve the data from 
					client using UDP sockets and display the entire network topology and adjacency matrix on the consoles.
	g. constants.h : Lists all the header files required along with the Linked List decleration.
	h. makefile : Compiles all the code and generates the executables.

##How to Run
 Specific order to run the code : client-->serverA-->serverB-->serverC-->serverD. Also please see 7.c to 7.f. Please always do 
   makeclean before using the re-running the code.




About

A basic project to understand the sockets in C and implement the Minimum Spanning Tree

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors