Question: Consider the following pseudocode for a chat program, running over a connected socket. This program deadlocks. Correct this. Client Server Read from socket Read from
Consider the following pseudocode for a chat program, running over a connected socket. This program deadlocks. Correct this.
| Client | Server |
| Read from socket | Read from socket |
| Print to screen | Print to screen |
| Read from keyboard | Read from keyboard |
| Send message over socket | Send message over socket |
-----------------------------------------------------------------------------
Consider the following pseudocode for a chat program, running over a connected socket. The above program does not allow one to send multiple messages without receiving a message in-between sends. Why not?
| Client | Server |
| Read from socket | Read from socket |
| Print to screen | Print to screen |
| Read from keyboard | Read from keyboard |
| Send message over socket | Send message over socket |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
