Skip to content

Improve the documentation for __next__() #73

Open
@JosiahDub

Description

@JosiahDub

After 924dfde, __next__() continues instead of returning None when timing out. This does not seem like ideal behavior. Am I misinterpreting timeout or misusing the function? Ideal code snippet:

import pcap
p = pcap.pcap(timeout_ms=50)
# Set the filter so that no packets will arrive
p.setfilter("port 55555")
try:
    timestamp, packet = p.__next__()
except TypeError:
    print("__next__() returned None in a reasonable time-frame!")

I modified pcap.pyx to return None and the code snippet worked.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions