This project is read-only.

problem with countinue the capture after break

Dec 23, 2013 at 7:14 AM
I am working with

I have a communicator that recieves packets. At some point I call the Break() function to stop the capture. after I stopped the capture, I want to continue the capture at some point..

I tried using the RecievePackets(HandlePacket, 0) again, but my GUI froze.. my code:

private void StartCapture()
_Communicator.RecievePackets(HandlePacket, 0);

private void StopCapture()

also importnat to say that all of this code is done not from the GUI thread.

the first time I start capture it works. then I break the capture. and after this. I try the _Communicator.RecievePackets(HandlePacket, 0) again and it freezes the GUI and everything.

any help?? thanks
Dec 29, 2013 at 5:06 PM
Hi ofekagmon,

This seems like a GUI issue rather than a Pcap.Net issue.
When you call ReceivePackets() you do a blocking call, so it will hold this thread.
If you'll change this call with an infinite loop, it would also hold the thread and I imagine it would also make your GUI freeze.
Can you try that and see?