review comments is // minsuk:

- don't use exit();
- remove unused local variable declaration
- remove unnecessary initialization of local variables.
- check return values of system functions including recv() (or read)