       console.log '...All jobs done'
       db.close()
 
-#    q.on 'jobStart', (args) ->
-#      console.log 'jobStart', args._jobId
-
-#    q.on 'jobEnd', (args) ->
-#      console.log 'jobEnd', args._jobId
-
     q.run()
 
 

    for ipdic in json_data.ips
      iplst.push ipdic.ip

    db.ips.find({},{'_id': false, 'port': false}).forEach (err, docs) ->
      if err then throw err
      if docs != null
        if docs.ip not in iplst
          db.ips.remove {ip: docs.ip}

    for ip in iplst
      q.add scanOne, ip


##scanner.coffee
fs = require 'fs'
exec = require('child_process').exec
mongojs = require 'mongojs'
http = require 'http'
qjobs = require 'qjobs'
