1

im having a nightmare of a time trying to get sharp Pcap to send packets happily via multiple instances of ICaptureDevice. The problem is that If i use more than one instance of ICaptureDevice any existing ones will just drop out and no error is thrown. I was wondering if you have any ideas on how to keep all instances of ICaptureDevice work happily. ( If you have had this issue)

Unfortunately I can not provide code examples as this is Proprietary software im building.

I have tried aggregrating all the packets into one queue stream and getting a single ICapDev to send them but i found this to be too slow for the device recieving them at the other end.

Many thanks for any help

Gelion
  • 531
  • 7
  • 18
  • i forgot to mension i am running a dedicated thread for each of these ICapDev's too – Gelion Oct 17 '11 at 10:08
  • Can you provide a simple example that doesn't contain any proprietary code? Each capture device should be independent as they are tied to a physical device. Are you trying to send through a single physical device with multiple threads? – Chris Morgan Oct 17 '11 at 12:49
  • well the theory behind the software is to emulated multiple devices connecting to one single device - each emulated device has multiple ICaptureDevices to handle each individual connection as the software is both a client and server at the same time. all packets from all emulated devices are going through a single NIC. – Gelion Oct 17 '11 at 13:29
  • Are you using the same technique as in the multiple filters example? Otherwise youll get the same device each time from the list. This is done so users can say devices[x].open() and close and not open one class instance and close another. – Chris Morgan Oct 17 '11 at 17:52
  • 1
    I'm the author of sharppcap, drop me an email if that is better/faster than this is, chmorgan@gmail.com – Chris Morgan Oct 17 '11 at 18:16

1 Answers1

2

Ok i had a talk with Chris - the use of CaptureDeviceList.New()[i] is advised instead of CaptureDeviceList.Instance[i].

Gelion
  • 531
  • 7
  • 18