 				if sys.url		 then me.streamer.url = me.stream.getStreamPath() + sys.url
 
 				if sys.streams? then me.stream.getStreams (code, data) ->
-					if !code then me.socket.emit 'sys', JSON.stringify {sys:{streams: data }}
+					if !code then me.serv.io.sockets.emit 'sys', JSON.stringify {sys:{streams: data }}
 					else console.log "WARNING Error controller: " + data
 
 				if sys.sample && sys.classe then me.dataset.addCurrent sys.sample, sys.classe, me.streamer.getSampleFile(), (code, data) ->


				# DATABASE RECORD EVENTS
				if sys.records?.list?	then me.dataset.getDatabases (code, data) ->
					if !code then me.socket.emit 'sys', JSON.stringify {sys:{records:{list: data }}}
					else console.log "WARNING Error controller: " + data

				if sys.records?.build


		me.streamer 	= new (require('./streamer.js')).Streamer (state)->
			if me.socket
				me.serv.io.sockets.emit 'sys', JSON.stringify( {sys: {state:state, sample_count:me.streamer.getSampleCount()} } )

		me.classifier  = new (require('./classifier.js')).Classifier me.streamer.getSampleFile(), (code, data) ->
			if me.socket
				me.serv.io.sockets.emit 'data', data
		me.classifier.init()

		me.serv.io.on 'connection', (socket) ->
			me.socket = socket
			setTimeout (->
				me.serv.io.sockets.emit 'data', JSON.stringify(me.classifier.getConf())
				), 5000

#			me.serv.io.sockets.emit 'sys', 'test'

			socket.on 'sys', (msg) ->
				console.log 'sys event: ' + msg.toString()
