def polling_read(self, read_length, timeout):
    data = ''
    if (timeout is None):
        timeout = 3600
    time_left = timeout
    CHUNK_TIME = 0.025
    bytes_left = read_length
    while (bytes_left > 0):
        try:
            (ready, _, _) = select.select([self._sock.fileno()], [], [], 0)
            if (not ready):
                if (time_left <= 0):
                    raise NetBIOSTimeout
                else:
                    time.sleep(CHUNK_TIME)
                    time_left -= CHUNK_TIME
                    continue
            received = self._sock.recv(bytes_left)
            if (len(received) == 0):
                raise NetBIOSError('Error while reading from remote', ERRCLASS_OS, None)
            data = (data + received)
            bytes_left = (read_length - len(data))
        except select.error as ex:
            if ((ex[0] != errno.EINTR) and (ex[0] != errno.EAGAIN)):
                raise NetBIOSError('Error occurs while reading from remote', ERRCLASS_OS, ex[0])
    return data
def polling_read(self, read_length, timeout):
    data = 
    if (timeout is None):
        timeout = 3600
    time_left = timeout
    CHUNK_TIME = 0.025
    bytes_left = read_length
    while (bytes_left > 0):
        try:
            (ready, _, _) = select.select([self._sock.fileno()], [], [], 0)
            if (not ready):
                if (time_left <= 0):
                    raise NetBIOSTimeout
                else:
                    time.sleep(CHUNK_TIME)
                    time_left -= CHUNK_TIME
                    continue
            received = self._sock.recv(bytes_left)
            if (len(received) == 0):
                raise NetBIOSError('Error while reading from remote', ERRCLASS_OS, None)
            data = (data + received)
            bytes_left = (read_length - len(data))
        except select.error as ex:
            if ((ex[0] != errno.EINTR) and (ex[0] != errno.EAGAIN)):
                raise NetBIOSError('Error occurs while reading from remote', ERRCLASS_OS, ex[0])
    return data