def METHOD_NAME(fd):
    header = fd.read(48)
    #print "getheader got %d bytes from %s" % (len(header),str(fd))
    if header == 'bye'.ljust(48, '-'):
        raise DisconnectException('Disconnect')
    if len(header) == 0:
        #print 'got 0 bytes from %s' % (str(fd),)
        return ('', 0, 0, 0)
    else:
        hdr = struct.unpack('Iihbbbbbbiiiiiiii', header)
        nbytes = hdr[0]-48
        nargs = hdr[3]
        idx = hdr[4]
    return (header, nbytes, nargs, idx)