You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Client (browser Chrome latest version):
Connect to server, pull out the plug online, wait 2 minutes, plug connect the Internet again.
Trigger events: disconnect, then reconnect.
The client when receiving data see error message in the console
Uncaught TypeError: Converting circular structure to JSON
and no data is being received.
From client to server data is transferred perfectly
Problems arise only when the client is lost internet connection. If the client does not reconnect no problem.
I see the error in your socket.io library.
Write how you can solve the problem?
Client (browser Chrome latest version):
Connect to server, pull out the plug online, wait 2 minutes, plug connect the Internet again.
Trigger events: disconnect, then reconnect.
The client when receiving data see error message in the console
Uncaught TypeError: Converting circular structure to JSON
and no data is being received.
From client to server data is transferred perfectly
Problems arise only when the client is lost internet connection. If the client does not reconnect no problem.
I see the error in your socket.io library.
Write how you can solve the problem?
Client Code (browser Chrome latest version):
var socket = io.connect('http://consultant.laura.ru:1988');
socket.on('disconnect', function () {
socket.client = client;
socket.emit('client_disconnect', socket);
console.log('Клиент '+client.client_id+' отключен');
});
socket.on('sendMessage', function (data) {
var audio = $("._quty_chat #c_sound")[0];
audio.play();
setMessage(data);
});
$('._quty_chat .c_send').click(function(){
var msg = $('._quty_chat .c_write input').val();
});
Server code (NodeJS last version):
var io = require('socket.io').listen(1988);
io.set('log level', 1);
io.set('transports', ['websocket', 'flashsocket', 'htmlfile', 'xhr-polling']);
var operators = []; //Операторы онлайн
var clients = []; //Клиенты онлайн
io.sockets.on('connection', function (socket) {
socket.on('reconnect_client', function (data) {
socket.client = data;
clients[data.client_id] = socket;
});
The text was updated successfully, but these errors were encountered: