When the socket down the "read" function returns -1. Then the while(read_byte > 0) only works for signed types.