Question: Assignment rules ( read carefully ) : Like the previous program, this program will not be graded on correctness, however there are still requirements as
Assignment rules read carefully: Like the previous program, this program will not be graded on correctness, however there are still requirements as described below. To get a high grade, do your own work on the topic below, turn it in on time and make sure to correct warnings and errors which I can help you with if you start early I suggest each task not marked as advanced, at minimum, to understand the material well. At that point with errors and warnings corrected, you can turn it in for full points, then attempt the advanced suggestions for additional understanding and practice without worrying about errors or warnings affecting your grade
Requirements:
For this program, your files must compile via a working makefile using the make command. The network examples come with a make file already setup so you may use that as is and just modifying the client and server programs. If you switch to a single program, make sure to modify the makefile accordingly. You must test your programs using multiple Putty instances, one for the server and one per client.
Set your client and server to use a fixed port equal to ID If your classes login ends with numbers, just use that as your ID Example: cs will ID so port is If your ID ends with letters such as aa convert the left letter a b c and so on Then convert the right letter to a value from to a b and so on So csaa uses port And csbf must use port You must use your assigned port or you may have conflicts with other students.
You must do your own work and it must be on the current topic described below.
I will use a program that compares your program to those of other students and to my examples to check for similarity. If your program is grouped with others due to similarity, Ill manually review them to check for cheating. This checker is not fooled by changing variable names, order of statements, adding comments or other basic program changes.
For full points, you must still correct errors especially and warnings generated by using flags when compiling.
Note: code you find on the Internet is likely to trigger a lot of compiler warnings as its usually not written with our expanded compiler warnings in mind. Also, if two or more students copy a large part of the same code from the Internet, this will look like cheating because it is so dont take that risk. Its ok to be inspired or informed by outside code, just avoid copying it especially large blocks of it
Ill also be checking for excessively simple or empty programs. Its easy to avoid warnings and errors if your program does very little. This may be considered cheating if very excessive or otherwise may result in a to grade similar or worse than a program with errors
Topic and Suggested Work: Networking example anetworking or ab
Modify the first network example so that the client and server engage in backandforth communication by putting the read and write code in a loop recall both server and client can read from or write to the connection socket once established
Notice that when either client or server is waiting for the user to input a message, it will block and thus cannot receive and print messages on the socket, and similarly while waiting to read from the socket, the user cannot input messages to send. Reprogram your client and server to handle reading and writing in separate threads to avoid this problem. This will allow each program to receive user or socket input asynchronously. Note: printf output sent to screen by the socket reading thread will interrupt partially typed user input this is not correctable with the material weve learned this semester
Advanced: modify the server to accept multiple clients and spawn readwrite threads for each. Allow the clients to interact through the server such as implementing a game or simple chat server where the server passes messages from one client to other clients. Use mutex protected shared structures to share data among threads as needed.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
