subject
Computers and Technology, 12.12.2019 02:31 lyrique

Design and implement the following tasks. first, name your server program: a4server2.c (or a4server2.cpp) and client program: a4client2.c (or a4client2.cpp).#1. timer to be set for the lifetime of server and client to run. place a timer for each server and client, to terminate itself after 5 minutes of the run.#2. two clients and a log file for each clienteach client (when it starts) takes one more argument to output its result from the server to a log file of each client (instead of the console output).the client (when it starts) takes 5 arguments: (1) the server's ip address, (2) the port number that the server is listening, (3) "your-netid" should be your log-in userid (that is, your utd netid which is used for verification with the server side), (4) client transaction-file name (which contains a list of transaction to be read by the client to be sent to the server to be processed), and (5) client log-file name (where the client outputs: its status, each transaction, and the result of each transaction from the server).to run the client, for example: a4client2 server-ip-address server-port-number your-netid a4client2test1.txt a4client2out1.txt & a4client2 server-ip-address server-port-number your-netid a4client2test2.txt a4client2out2.txt & where "a4client2" is the client program with the arguments. the server-ip-address is the ip address of the server (and you may use 127.0.0.1 if this is the local server). the server-port-number is the port-number of the server is listening. for the first client2 program run, the "a4client2test1.txt" file is the transaction file to be used by the first client2 program). the "a4client2log1.txt" file is the log file of the first client2 program where all the results from the server to this client will be output here. for the second client2 program run, the "a4client2test2.txt" file is the transaction file to be used by the first client2 program). the "a4client2log2.txt" file is the log file of the first client2 program where all the results from the server to this client will be output here. for the program run and test. name your program run-log to be: a4part2runlog. txtyour log file of the program run (of all the session log and history, etc.) should be kept in the same folder for this part and to be submitted to elearning. you may copy and paste your program run & session history (e. g., from the mobaxterm or putty log file).transaction-file (of a client) contains the following test transactions for the client to read it and send it to the server. note that each transaction record has a transaction number (00, 01, 02, …) to be sent to the server. use the following test transaction script for this part.** use the following test script (named as "a4client2test1.txt") as your test transaction file for this part.00 start-of-transaction your-netid01 echo " ** a4client2test1.txt **"; date; whoami; hostname02 ls a4*03 ls -l a4server*04 ls -l a4client*05 end-of-transactionfor the second client2 program, use this transaction file (named "a4client2test2.txt")00 start-of-transaction your-netid01 echo " ** a4client2test2.txt **"; date; whoami; hostname02 ls /etc | wc03 ls /etc | head04 ls05 end-of-transaction// sample code to set a timer to interrupt after some time (to terminate the run).#include #include #include #include #include static int timer_expired = 0; static void alarm_handler(int sig){timer_expired=30; }int main(){// set up a signal hander to call alarm_handler()// when sigalrm is raisedsigaction(sigalrm, & (struct sigaction){.sa_handler = alarm_handler}, null); time_t t; srand((unsigned) time(& t)); timer_expired = 0; alarm(1); // raise sigalrm in 1 secondswhile (! timer_expired) {int s=(rand()%4)+1; printf("%d", s); }return 0; }

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 01:30
For a typical middle-income family, what is the estimated cost of raising a child to the age of 18? $145,500 $245,340 $304,340 $455,500
Answers: 2
question
Computers and Technology, 23.06.2019 06:00
When is a chart legend used a. all the time b. whenever you are comparing data that is the same c. whenever you are comparing multiple sets of data d. only for hand-drawn charts
Answers: 2
question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. a company wants to use online methods to target more customers. it decides to conduct a market research by collecting the data of a few customers with their consent. they want to track data of the sites that their customers frequently visit. which software can the company? a. spyware b. bots c. adware d. trojan horse e. rootkits
Answers: 1
question
Computers and Technology, 24.06.2019 00:20
Describe a data structures that supports the stack push and pop operations and a third operation findmin, which returns the smallest element in the data structure, all in o(1) worst-case time.
Answers: 2
You know the right answer?
Design and implement the following tasks. first, name your server program: a4server2.c (or a4server...
Questions
question
Mathematics, 21.04.2021 18:10
question
Mathematics, 21.04.2021 18:10