I cannot figure out the hot state to disconnect the established socket.io connection. This is a simple socket.io configuration:
var app_rf = http.createServer(function(req, res) {}); var io = require('socket.io').listen(app_rf); app_rf.listen(3001);
I am sending data via:
io.sockets.emit('series_results', result_rf );
and read it in a browser using
var socket = io.connect('//localhost:3001'); socket.on('series_results', function(data) { $('.results_rf').append("<p class='output_rf'>Gender- "+data+"</p>"); });
I am trying to use io.disconnect ('// localhost: 3001') on the client, but it does not work. My problem is that since the connection is not closed, messages are saved, not destroyed. If I can destroy messages, this will work for me too.
source share