In this exercise, you will built upon the small server you just implemented to add new functionalities.
So far your server, i.e. the code that receive the message and performs the sum, sent back the result as network-ordered unsigned integers. In this task you have to change the format of the result. Instead of using network-ordered unsigned integers, the result must be encoded as a string. Use the sprintf() call to achieve this.
For each of the calls that you use, if one of them were to encounter an error, immediately return -1. All require headers are already included.
Manpages of interest:
- http://man7.org/linux/man-pages/man2/socket.2.html
- http://man7.org/linux/man-pages/man7/ipv6.7.html
- http://man7.org/linux/man-pages/man2/bind.2.html
- http://man7.org/linux/man-pages/man2/recvfrom.2.html
- http://man7.org/linux/man-pages/man2/sendto.2.html
- http://man7.org/linux/man-pages/man3/htonl.3.html
- http://man7.org/linux/man-pages/man3/printf.3.html