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, 22.06.2019 02:30
Larry sent an email to andy. andy didn't open larry's email but still understood what the message was. how did andy determine the message without opening the email?
Answers: 1
question
Computers and Technology, 22.06.2019 06:00
In outlook how can cherie look at the details of an event that appears on the month view of her calendar? check all that apply. by switching to the detail view by switching to the week view by switching to the day view by right-clicking on the event by double-clicking on the event by highlighting the event
Answers: 2
question
Computers and Technology, 23.06.2019 03:30
In vista and windows 7, the appearance and personalization option allows you to change the
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
1. which of the following statements are true about routers and routing on the internet. choose two answers. a. protocols ensure that a single path between two computers is established before sending packets over it. b. routers are hierarchical and the "root" router is responsible for communicating to sub-routers the best paths for them to route internet traffic. c. a packet traveling between two computers on the internet may be rerouted many times along the way or even lost or "dropped". d. routers act independently and route packets as they see fit.
Answers: 2
You know the right answer?
Design and implement the following tasks. first, name your server program: a4server2.c (or a4server...
Questions
question
English, 20.12.2020 02:20
Questions on the website: 13722361