PcapHandle.dispatch
int dispatch(int cnt, void delegate(const(pcap_pkthdr) * header, const(ubyte) * data) callback)Processes packets available in the current buffer.
Similar to loop, but only processes packets currently available in the capture buffer and then returns. The callback delegate is GC-rooted for the duration of the call.
Parameters
cnt | Maximum number of packets to process. |
callback | The delegate to call for each packet. |
Returns
The number of packets processed, 0 if EOF, -1 on error, -2 if breakLoop was called.