One day, a friend came to me and asked how to scan a TCP or UDP port. With that question, I wrote a simple little port scanner to demonstrate at least one approach to the problem. Once written I found out that it wasn't one port but thousands. Well, now it is time for some metrics... As it turns out, my little sample took 2 minutes and 5 seconds to scan 1024 ports. While it worked, it needed to be faster. After scratching my head a bit, I wrote a new port scanner that performed scans on a pool of threads. Now it scanned the same port range in 2.2 seconds. What can I say, multithreading is groovy stuff. :-)
Tags: side projects