in reply to Re: Re: Suggestions & Improvements
in thread Suggestions & Improvements on a portscanner using IO::Socket
Also, at some point you probably get diminishing returns until you have so many forks that none of them get done in a reasonable amount of time.
So...keep a counter of how many forks you have launched and don't start new ones until some have been reaped. (see waitpid...). On my own scanner and on various stress testing clients, I have provided the number of forks to be defined at command line (or defaulted to 5 at a time). See nmap.
IO:Select is not what you want here. Not only is it not threading or forking, but is actually used to multiplex reading and writing to/from handles that have already been established. Once you get the scanner done, write a multiplexing server for some real fun and a good introduction to network server coding. :-)
Have a blast!
|
|---|