I am using Pcap.Net
to transmit packet through my machine adapter, i some cases i am read packets from several files in the same time using Parallel.ForEach
with MaxDegreeOfParallelism
property that can be changed.
So i wonder if i need to lock the object that sent this packet..
This is how my main send the packets:
// Open the my device
using (PacketCommunicator communicator = selectedDevice.Open(100, PacketDeviceOpenAttributes.Promiscuous, 1000))
{
Packet packet;
// Read packet from file
while (inputCommunicator.ReceivePacket(out packet) == PacketCommunicatorReceiveResult.Ok)
{
// Send packet
communicator.SendPacket(packet);
}
}