@@ -407,16 +407,16 @@ if (typeof window.ChatManager === 'undefined') {
|
|||||||
transports: ['polling', 'websocket'],
|
transports: ['polling', 'websocket'],
|
||||||
upgrade: true,
|
upgrade: true,
|
||||||
reconnection: true,
|
reconnection: true,
|
||||||
reconnectionAttempts: 5,
|
reconnectionAttempts: Infinity,
|
||||||
reconnectionDelay: 1000,
|
reconnectionDelay: 1000,
|
||||||
reconnectionDelayMax: 5000,
|
reconnectionDelayMax: 5000,
|
||||||
timeout: 10000,
|
timeout: 20000,
|
||||||
autoConnect: false, // Don't connect automatically
|
autoConnect: true,
|
||||||
forceNew: true,
|
forceNew: true,
|
||||||
multiplex: false,
|
multiplex: false,
|
||||||
pingTimeout: 30000,
|
pingTimeout: 60000,
|
||||||
pingInterval: 10000,
|
pingInterval: 25000,
|
||||||
upgradeTimeout: 5000,
|
upgradeTimeout: 10000,
|
||||||
rememberUpgrade: true,
|
rememberUpgrade: true,
|
||||||
rejectUnauthorized: false,
|
rejectUnauthorized: false,
|
||||||
extraHeaders: {
|
extraHeaders: {
|
||||||
@@ -446,12 +446,6 @@ if (typeof window.ChatManager === 'undefined') {
|
|||||||
state.connectionState.hasJoined = true;
|
state.connectionState.hasJoined = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Connect only when the page is fully loaded
|
|
||||||
$(window).on('load', function() {
|
|
||||||
console.log('Page loaded, connecting socket...');
|
|
||||||
socket.connect();
|
|
||||||
});
|
|
||||||
|
|
||||||
socket.on('disconnect', function(reason) {
|
socket.on('disconnect', function(reason) {
|
||||||
console.log('Disconnected from conversation:', {
|
console.log('Disconnected from conversation:', {
|
||||||
reason: reason,
|
reason: reason,
|
||||||
|
|||||||
Reference in New Issue
Block a user