Note that the server sends each client's message to the others with the client's name as a prefix: "mo: hello?". Also note that the prompt printing ($:) on a client can get oddly interleaved with the output of messages from other clients. You are not required to fix this oddness, but if you want to try to make the client side look better, one way is to use ascii escape codes to print the messages from other clients in a different font color(s) so that it is easier to differentiate a client's input and other's output. For some examples, see: ascii escape codes. You could also try something more elaborate using ncurses (see: cool C libraries for some links to ncurses). One idea is to use ncurses to split the screen in half with the client program's input (stdin) in the bottom half, and the program's output (stdout) in the top.
====================================== Server output: ====================================== eagle% ./cs87_server Accepted new client socket. New client (mo) passed HELLO check. Accepted new client socket. New client (freya) passed HELLO check. Accepted new client socket. New client (jake) passed HELLO check. ====================================== Client 1's output: ====================================== bluejay% ./cs87_client 130.58.68.210 mo Hello mo, you are trying to connect to talk server 130.58.68.210 enter next message at the prompt or goodbye to quit Connected. $: hello? mo: hello? $: is anybody out there? mo: is anybody out there? $: freya: hello, who is there? hi Freya I'm here (mo) mo: hi Freya, I'm here (mo) $: freya: hi mo, do you have any licorice? jake: hello there jake: is anybodyout there freya: hi jake this is freya, I think mo is here too hi freya mo: hi freya $: goodbye Sending QUIT! bluejay% ====================================== Client 2's output: ====================================== pimento% ./cs87_client 130.58.68.210 freya Hello freya, you are trying to connect to talk server 130.58.68.210 enter next message at the prompt or goodbye to quit Connected. $: hello, who is there? freya: hello, who is there? $: mo: hi Freya, I'm here (mo) hi mo, do you have any licorice? freya: hi mo, do you have any licorice? $: jake: hello there jake: is anybodyout there hi jake this is freya, I think mo is here too freya: hi jake this is freya, I think mo is here too $: mo: hi freya hi mo freya: hi mo $: mo? freya: mo? $: mo, are you there mo? freya: mo, are you there mo? $: goodbye Sending QUIT! pimento% ====================================== Client 3's output: ====================================== duck% ./cs87_client 130.58.68.210 jake Hello jake, you are trying to connect to talk server 130.58.68.210 enter next message at the prompt or goodbye to quit Connected. $: hello there jake: hello there $: is anybodyout there jake: is anybodyout there $: freya: hi jake this is freya, I think mo is here too mo: hi freya freya: hi mo freya: mo? freya: mo, are you there mo? hello??? jake: hello??? $: goodbye Sending QUIT! duck%