Question: Create your application in a file called lastname _ netid _ chat.c , following the requirements in the General Section. Build the project with the

Create your application in a file called lastname_netid_chat.c, following the requirements in the General Section. Build the project with the udp3.c and kbhit.c to make sure you are able to proceed.4. Add code to open a local listener port so you can receive messages from other users, following the requirements in the Listener Port Startup Section. 5. In this peer-to-peer application, the program enters a loop that:a. Calls kbhit() to see if a key has been hit on the local keyboard of the RPi.b. If a key has been hit, use fgets() to read in a string from file stdin.c. After fgets() returns, take the string from fgets and send the string to the remote port using sendUdpData() following the requirements in the Sending UDP Messages Sectiond. If QUIT was returned at the start of the string returned by fgets(), exit the loop and close the listener port following the requirements in the Shutdown Sectione. Attempt to receive a message from the remote port using receiveUdpData() following the requirements in the Receiving UDP Messages Sectionf. If data has been received, print the data in the right columng. If QUIT was received, exit the loop and close the listener port following the requirements in the Shutdown Sectionh. Repeat a-g until the program exitsNote that if a message arrives while you are typing, you will need to press ENTER on the keyboard to send that message to the remote device.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!