I can't figure out hot to disconnect an established socket.io connection.
It is 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 send data via:
io.sockets.emit('series_results', result_rf );
and read it in the browser with:
var socket = io.connect('//localhost:3001');
socket.on('series_results', function(data) {
$('.results_rf').append("<p class='output_rf'>Gender- "+data+"</p>");
});
I try with io.disconnect('//localhost:3001') on the client, but does not work.
My problem is that as the connection is not closed, the messages are kept, instead of destroyed. If I can destroy the messages, that would also work for me.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…