'Tests:
>>> l = listen()
>>> r = remote(\'localhost\', l.lport)
>>> r.can_recv_raw(timeout=0)
False
>>> l.send(\'a\')
>>> r.can_recv_raw(timeout=1)
True
>>> r.recv()
\'a\'
>>> r.can_recv_raw(timeout=0)
False
>>> l.close()
>>> r.can_recv_raw(timeout=1)
False
>>> r.closed[\'recv\']
True'

def can_recv_raw(self, timeout):

    if ((not self.sock) or self.closed['recv']):
        return False
    can_recv = (select.select([self.sock], [], [], timeout) == ([self.sock], [], []))
    if (not can_recv):
        return False
    try:
        self.recv_raw(1, socket.MSG_PEEK)
    except EOFError:
        return False
    return True
