'Called when my socket is ready for reading.'

def doRead(self):

    read = 0
    while (read < self.maxThroughput):
        try:
            (data, addr) = self.socket.recvfrom(self.maxPacketSize)
        except socket.error as se:
            no = se.args[0]
            if (no in _sockErrReadIgnore):
                return
            if (no in _sockErrReadRefuse):
                if self._connectedAddr:
                    self.protocol.connectionRefused()
                return
            raise
        else:
            read += len(data)
            if (self.addressFamily == socket.AF_INET6):
                addr = addr[:2]
            try:
                self.protocol.datagramReceived(data, addr)
            except:
                log.err()
