want code in C:
and please answer the
question!![Goal: To improve the client-server model introduced in the class Requirements: The server should be able to accept requests from multiple clients and communicate with them. .Each client should be able to communicate multiple rounds of messages with the server. .Whenever the server receives a message from a client, it replies with I got your message To implement the server with multithreading. .A client program should terminate its communication with the server when its user types in EXIT, causing no effect on other clients You can manually terminate the server using Ctrl C or you can implement it to terminate itself on a certain input from keyboard .The server and client should take arguments in the following formats server.exe [port number] client.exe [servers name] [port number] Your programs will be tested and graded using computers in Lab QBB 244 under the LINUX/UNIX mode. To submit .Source codes](http://img.homeworklib.com/questions/39b88480-bf2e-11ea-aebb-1d643721b40b.png?x-oss-process=image/resize,w_560)

Please let me know if you have any doubts or you want me to modify the code. And if you find this code useful then don't forget to rate my answer as thumps up. Thank you! :)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <pthread.h>
void error(const char *msg)
{
perror(msg);
exit(1);
}
void *threadFunction(int mysockfd)
{
char bufferThread[256];
int nThread;
while(1)
{
bzero(bufferThread,256);
nThread =
read(mysockfd,bufferThread,255);
//read message from mysockfd
if (nThread < 0) error("ERROR
reading from socket");
printf("Here is the message:
%s\n",bufferThread);
if(strcmp(bufferThread, "EXIT\n")
== 0)
{
printf("Network
Terminated\n");
close(mysockfd);
return
NULL;
}
//close mysockfd if message is
"EXIT\n"
nThread = write(mysockfd,"I got
your message",18);
//acknowledge to client
if (nThread < 0) error("ERROR
writing to socket");
}
close(mysockfd);
return NULL;
}
int main(int argc, char *argv[])
{
int sockfd, newsockfd, portno;
socklen_t clilen;
char buffer[256];
struct sockaddr_in serv_addr,
cli_addr;
int n;
if (argc < 2) {
fprintf(stderr,"ERROR, no port provided\n");
exit(1);
}
sockfd = socket(AF_INET, SOCK_STREAM, 0);
if (sockfd < 0)
error("ERROR opening
socket");
bzero((char *) &serv_addr,
sizeof(serv_addr));
portno = atoi(argv[1]);
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr =
INADDR_ANY;
serv_addr.sin_port = htons(portno);
if (bind(sockfd, (struct sockaddr *)
&serv_addr,
sizeof(serv_addr)) < 0)
error("ERROR on binding");
while(1)
{
listen(sockfd,5);
clilen = sizeof(cli_addr);
newsockfd = accept(sockfd,
(struct sockaddr *)
&cli_addr,
&clilen);
if (newsockfd < 0)
error("ERROR on accept");
pthread_t pth; //this
is the thread identifier
pthread_create(&pth,NULL,threadFunction,newsockfd);
//generage a new thread
}
close(sockfd);
return 0;
}
want code in C: and please answer the question! Goal: To improve the client-server model introduced...
Here is the description of the client and server programs that you need to develop in C using TCP: Suppose we have a simple student query system, where the server keeps student's info in an array of struct student_info ( char abc123171 char name [101 double GPA; To simplify the tasks, the server should create a static array of 10 students with random abc123, name, and GPA in the server program. Then the server waits for clients. When a client...
Project Description In this project, you will be developing a multithreaded Web server and a simple web client. The Web server and Web client communicate using a text-based protocol called HTTP (Hypertext Transfer Protocol). Requirements for the Web server The server is able to handle multiple requests concurrently. This means the implementation is multithreaded. In the main thread, the server listens to a specified port, e.g., 8080. Upon receiving an HTTP request, the server sets up a TCP connection to...
Objective: Create programs that are run independently and can use simple IPC using FIFOs/named pipes to pass information back and forth in a client/server fashion. The information/request from the client will look like simple semaphore system calls and will include information for the server to be able to identify which client requested it and what request it is and its associated parameters. This assignment requires the analysis, implementation, testing and documentation of two C program that use C on the...
In Python, make changes in the client code, so that the client allows the user to continue to send multiple requests until the user types in “Quit”. This means that the client process should not exit after the user sends one request and receives one response. Instead, the client process should be able to receive subsequent inputs from the user. You need to have a loop in the client code, so that it can accept the user request until the...
I need help with this assignment, please; Programming Assignment 3: UDP Pinger Lab In this lab, you will study a simple Internet ping server written in the Java language, and implement a corresponding client. The functionality provided by these programs is similar to the standard ping programs available in modern operating systems, except that they use UDP rather than Internet Control Message Protocol (ICMP) to communicate with each other. (Java does not provide a straightforward means to interact with ICMP.)...
This is in C. For this assignment we will write a simple database server. We will be creating a simple database of student records, so let’s describe these first. The format of a student record is as follows: typedef struct student { char lname[ 10 ], initial, fname[ 10 ]; unsigned long SID; float GPA; } SREC; Part One – the Server We will create a database server. The job of the server is to accept a...