(solution) Write an echo server using socket programming in UNIX using C

(solution) Write an echo server using socket programming in UNIX using C

Write an echo server using socket programming in UNIX using C programming. (both, client side and server side).

The server will loop, performing the following steps:

  • Read data from the socket into a buffer.
  • Write the contents of the buffer back to the client.

The client will

  • Read data from the user into a buffer.

Write an echo server using socket programming in UNIX using C programming. (both, client side and server side).

The server will loop, performing the following steps:

  • Read data from the socket into a buffer.
  • Write the contents of the buffer back to the client.

The client will

  • Read data from the user into a buffer.
  • Send the contents of the buffer to the server.
  • Send the contents of the buffer to the server.

CSEN5322 ? Operating Systems
Homework-3
Student Name Student ID Section Date Echo server
An echo server echoes back whatever it receives from a client. For example, if a client sends the
server the string ?Hello there!? the server will respond with the exact data it received from the client
?that is, Hello there!
Write an echo server using socket programming in UNIX using C programming. (both, client side
and server side).
The server will loop, performing the following steps: Read data from the socket into a buffer. Write the contents of the buffer back to the client.
The client will Read data from the user into a buffer. Send the contents of the buffer to the server.
– This programming assignment is to be completed individually. Your code must compile and run.
Remember to include the necessary documentation in the source code and in the output.
Hand in a copy of the source code and the copy of the output. Review the grading algorithm before you submit
your work!
Remember that all Homework/Assignments are to be completed individually. All violations of the TAMUK
honor code will be reported. Duplicate programs will not receive credit. (Further consequences may apply)
Grading algorithm
12% – Style
(5) Prologue comments including:
Programmer name, Course and section #, Program description, Date ?
(4) Document each variable and constant
(3) Indentation and spacing
80% – Correctness of your algorithm
(40) server-side program is correct
(40) client-side program is correct
8% – Attractiveness of the output
(2) Output correctly to monitor.
(2) Output contains a heading
(2) Programmer name and course/section info should be included in the output
(2) Labels, spacing, no misspelled words
Total 100%