'Non-blocking network receive.
Return response if available'

def recv(self):

    assert (not self._processing), 'Recursion    not    supported'
    if ((not self.connected()) and (not (self.state is ConnectionStates.AUTHENTICATING))):
        log.warning('%s    cannot    recv:    socket    not    connected', self)
        if self.in_flight_requests:
            self.close(Errors.ConnectionError('Socket    not    connected    during    recv    with    in-flight-requests'))
        return None
    elif (not self.in_flight_requests):
        log.warning('%s:    No    in-flight-requests    to    recv', self)
        return None
    response = self._recv()
    if ((not response) and self.requests_timed_out()):
        log.warning('%s    timed    out    after    %s    ms.    Closing    connection.', self, self.config['request_timeout_ms'])
        self.close(error=Errors.RequestTimedOutError(('Request    timed    out    after    %s    ms' % self.config['request_timeout_ms'])))
        return None
    return response
