Socket programming with c

profilezchang91

  

In the provided client.c and server.c program (please download from the folder socket programming), after the client receives “This server has been contacted 1 time” from the server, the client process exits.

Modify the client.c and server.c in this way: after the client receives “This server has been contacted 1 times”, instead of exit, the client sends back “This client has been contacted 1 times” to the server. The server then sends back “This server has been contacted 2 times”, the client sends back “This client has been contacted 2 times” to the server, and so on. That is, both the client and the server do not exit. They alternatively send messages to each other.

  • 5 years ago
  • 10
Answer(0)