         message.push '\r\n'
         message.join '\r\n'
 
+
     ssdpSend = (socket, message, callback) ->
         socket.send message, 0, message.length, config['network']['ssdp']['port'], config['network']['ssdp']['address'], (err) ->
+            event.emit 'ssdpMsg', "SSDP message sent on port #{socket.address().port}"
             callback err
 
     makeAdvDelay = ->

dgram = require 'dgram'
url = require 'url'
device = require './device'

# Initializes a UPnP Device
start = (config, callback) ->


    advertise (err, port) ->
        setInterval advertise, makeAdvDelay(), (err, port) ->
            callback err

exports.start = start
