'Reads all pending incoming data.
Raises IOError on disconnection.
Blocks until at least one byte is read.'

def receive(self):

    try:
        received = self._recv(10240)
    except:
        received = ''
    if len(received):
        self.DEBUG(((`self.fileno()` + '    ') + received), 'got')
    else:
        self.DEBUG('Socket    error    while    receiving    data', 'error')
        self.set_socket_state(SOCKET_DEAD)
        raise IOError('Peer    disconnected')
    return received
