0

Can anyone help me please? I'm using PacketDeviceOpenAttributes.NoCaptureLocal flag in PacketCommunicator and a when I send packet, my communicator is always capturing my packet as received packet. Thank you.

Simon Štefunko
  • 33
  • 1
  • 10
  • Are you using the same communicator to send and receive the packets? Maybe share the code? – brickner Oct 15 '16 at 09:52
  • Possible duplicate of [C# Pcap.net communication](http://stackoverflow.com/questions/39935404/c-sharp-pcap-net-communication) – brickner Oct 15 '16 at 09:53
  • http://pastebin.com/KcUPbiwp here is my code – Simon Štefunko Nov 01 '16 at 11:45
  • yes, in this version of code i'm using only one communicator to receive and also send packets. Should I use two for one device? One for receiving and one for sending? thank you and sorry for late answer. – Simon Štefunko Nov 01 '16 at 11:46
  • The code is gone by now. Note that you should use the same communicator for both sending and receiving if you want to rely on NoCaptureLocal. Also, you should be mindful on how you do multi-threading. I would start without multiple threads and see if this works. – brickner Nov 26 '16 at 11:55

1 Answers1

1

PacketCommunicator isn't thread safe. If you're using the same communicator in different threads you should make sure to use a proper synchronization mechanism.

brickner
  • 6,595
  • 3
  • 41
  • 54