[Qt-interest] Advice on widget displaying network packets

BRM bm_witness at yahoo.com
Tue Jan 4 18:01:34 CET 2011


----- Original Message ----

> From: Giacomo S. <giacomo.strangolino at elettra.trieste.it>
> I need an advice before starting to implement an application  aimed at
> displaying information about network packets.
> 
> On heavy  network traffic, much information has to be displayed and
> updated.

I would highly advise using a multi-threaded approach:

1. A thread to interact with the network - keep it simple, just read it off the 
network and generate a signal with the data.
2. A thread to parse out the data you want to display - get the network data and 
then generate signals with the individual 

3. the main thread to display the information

Keeps it nice and clean and helps keep the network traffic out of the way of the 
GUI thread - so it's always responsive.

Displaying it in the GUI thread is a different issue - but you could easily 
queue it up in a buffer for a controlled update versus just trying to stuff it 
into the GUI on every signal.

 
> A  typical piece of information might contain the following info:
> 
> - net  device
> - protocol (tcp,udp,icmp..)
> - source/dest ip ports
> - connection  status (SYN,ACK,..., TIME WAIT)
> 
> Currently, I am using a konsole to  display such information. Each packet
> is described by a line like the  following:
> 
> [OK 8]OUT: [eth0] |TCP|  140.105.5.83:http-->192.168.205.64:ms-sql-s |A|
> TIME WAIT[natural  rule]
> 
> but I would like to implement another view for the  purpose.
> 

Seems like you are doing something similar to Wireshark  
(http://www.wireshark.org/) - so you might want to hop over and see what  they 
do to manage the GUI updating.

HTH,

Ben



More information about the Qt-interest-old mailing list