Question: Use the following data structure in your labwork.(C programming language) typedef struct data { int matrix[10][10]; int sum; }data; Provide TCP client-server codes for the
Use the following data structure in your labwork.(C programming language)
typedef struct data {
int matrix[10][10];
int sum;
}data;
Provide TCP client-server codes for the following:
1) Server will run forever and it accepts clients and writes the contents of the matrix and their sum (in the structure) coming from clients. Server will listen to port 3333 for accepting incoming clients.
2) Client prepares a structure data by filling the matrix that has random numbers, and writing the sum of the elements of the matrix into the sum variable of the structure. After that it connects to the server and sends the structure to the server.
3) Try to write codes without redundant variables and lines of code. Try to give logical names to the variables and functions
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
