TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

help with gtk program



Hi, 

I was playing with gtk and came up with a little
program that takes sitenames/ip addresses as input
and calculates round trip times and hops to the
destinations.

The round trip/hops code I borrowed from the ping and
traceroute source. This runs on a thread of its
own, scheduling icmp packets to be sent to each
destination every so often and also receiveing return icmp
packets. 

Each icmp packet it recieves it updates a CLIST in GTK. 

The problem is that the CLIST does not get refreshed
as soon as the data is written to the screen, but seems
kind of at random. I have a feeling this is because the data
is getting updated from an external thread and not from
within the gtk main loop control.

So I would like to know any way I can implement this ?
One way would be I guess to emit user defined signals from 
the other thread instead of just calling the gtk functions.

This is just a program I have been using to learn gtk and
one possible use of this was to see if I could do a search
for a file from a site like ftpsearch.lycos.com/ and
then try locate the best site for download. 

I do not think that a round trip time and a hop count will
be enough to decide on which is a good place to download from
but I was wondering if it was possible to get some estimate from
them. It would be nice if I could also figure out a way to 
find out the bandwidth and load of the server to help decide
a good download site in addition to round trip and hops.

Appreciate any ideas/help. 
Oh and you can download the code and try it out if you like from
(binary from) http://www.frontiernet.net/~pani/probe
(source from) http://www.frontiernet.net/~pani/probe-0.1.tar.gz

Also this has to be run as root, because it opens raw ports
which as I understand from the traceroute code can be done
only by root. So use very carefully if you must. Also any ideas
on how I can avoid having to run this as root this would be great !

Thanks,
sandipan