Skip to content

Docstring of processIncomingFrame is outdated #2637

Closed
@smurfix

Description

@smurfix

The docstring for processIncomingFrame still documents the old callback-based interface.

Also, looking at that code it seems that there is no way _processIncomingFrame could ever return a (nbytes>0, None) tuple. Thus the split between process… and _process… is outdated and should be reverted.

Also I'd like to propose adding a usage example to the docstring, along the lines of

buffer = bytearray()
while True:
    more = read_more_data()
    if not more:
        break
    buffer += more

    while True:
        used,pdu = decoder.processIncomingFrame(buffer)
        del buffer[:used]
        if pdu is None:
            break
        process(pdu)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions