How to save packets of different ip address to one file

May 4, 2014 at 9:10 AM
Edited May 4, 2014 at 9:17 AM
i try to start two thread for this task, communicator is for ip a and communicator2 is for ip b, like
    private void StartThread()
    {
        using (PacketDumpFile dump = communicator.OpenDump("C:\\test.pcap"))
        {
            communicator.ReceivePackets(0, dump.Dump);
        }
    }

    private void StartThread2()
    {
        using (PacketDumpFile dump2 = communicator2.OpenDump("C:\\test.pcap"))
        {
             communicator2.ReceivePackets(0, dump2.Dump);
          }
    }
but when i open the test.pcap with wireshark, it says the file appears to be damaged or corrupt as there is packet bigger than 65536 byte.

any help is appreciated.
Coordinator
May 9, 2014 at 5:52 PM
Hi nahs,

I haven't tried this but it makes sense you can't write to the same pcap file from two different threads in parallel.

I hope this helps,

Boaz.