reduce unnecessary calls to fcntl() while reading from the socket