To find free port numbers in windows.Just go to the command prompt and type the following
netstat -na find "
" . Note that the port numbers are to be given within the double quotes.Well the same : netstat -a grep will work for finding free port numbers in unix.