D
Dmitry Teslenko
Hello!
I'm making gui gtk application. I'm using pypcap
(http://code.google.com/p/pypcap/) to sniff some network packets.
To avoid gui freezing I put pcap call to another thread.
Pypcap call looks like:
pc = pcap.pcap()
pc.setfilter('tcp')
for ts, pkt in pc:
spkt = str(pkt)
...
Sadly, but this call in another thread blocks gtk gui thread anyway.
If I substitute pcap call with something else separate thread don't block
gui thread.
Using another process instead of thead isn't appropriate.
Thread initialization looks like and takes place before gtk.main():
self.__pcap_thread = threading.Thread(target = self.get_city_from_pcap)
self.__pcap_thread.start()
I'm making gui gtk application. I'm using pypcap
(http://code.google.com/p/pypcap/) to sniff some network packets.
To avoid gui freezing I put pcap call to another thread.
Pypcap call looks like:
pc = pcap.pcap()
pc.setfilter('tcp')
for ts, pkt in pc:
spkt = str(pkt)
...
Sadly, but this call in another thread blocks gtk gui thread anyway.
If I substitute pcap call with something else separate thread don't block
gui thread.
Using another process instead of thead isn't appropriate.
Thread initialization looks like and takes place before gtk.main():
self.__pcap_thread = threading.Thread(target = self.get_city_from_pcap)
self.__pcap_thread.start()