'Get next char from raw queue.
Block if no data is immediately available.  Raise EOFError
when connection is closed.'

def rawq_getchar(self):

    if (not self.rawq):
        self.fill_rawq()
        if self.eof:
            raise EOFError
    c = self.rawq[self.irawq]
    self.irawq = (self.irawq + 1)
    if (self.irawq >= len(self.rawq)):
        self.rawq = ''
        self.irawq = 0
    return c
