[Tutor] 3 questions for my port scanner project

Mark Kels mark.kels at gmail.com
Sun Feb 27 20:14:54 CET 2005

On Sun, 27 Feb 2005 16:00:12 -0000, Alan Gauld <alan.gauld at freenet.co.uk> wrote:
> One option:
> Use a set up gif images and update the image periodically
> OR
> Use a canvas and redraw a rectangle slightly larger every
> time through the scanning loop.

Thats think this is the easy part...
The hard part is to make the bar move "with" the program (so every
port it finishes the bar will slightly move, which depends on the
total number of ports to scan...).

> The best way is to have the loop running in a seperate thread
> to the GUI and checking a flag on each iteration. Then you can
> have a stop button on the GUI that sets the flag.
> Its generally a bad idea in a GUI to have long running processes
> within an event handler, better to put them in a separate thread.
> Unfortunately this is a lesson that Microsoft's programmers don't
> appear to have learned yet!

I knew I will have to learn threads some day...
Are they hard ?
Can you give me some good and simple tutorials ? (I found some, but
they look scary)

> Alan G.

1. The day Microsoft makes something that doesn't suck is probably the
day they start making vacuum cleaners.
2. Unix is user friendly - it's just picky about it's friends.
3. Documentation is like sex: when it is good, it is very, very good.
And when it is bad, it is better than nothing. - Dick Brandon

More information about the Tutor mailing list