recv and send should return int instead of unsigned int so errors can be detected