phpsocket.io icon indicating copy to clipboard operation
phpsocket.io copied to clipboard

Got disconnect packet

Open tolew1 opened this issue 5 years ago • 7 comments

I don't know why I randomly get this error but nothing is being disconnected. I have it setup to emit a comment to send a comment/text. Randomly it will show got disconnect packet which gets disconnects the receiver.

It's not calling ondisconnect. What could be causing this and are there any error logs because I can't find them if there are.

tolew1 avatar May 09 '19 09:05 tolew1

Just a log, please ignore it.

walkor avatar May 10 '19 08:05 walkor

The problem is when this happens my user gets disconnected. Which causes problems for what I'm using it for. I'm trying to understand why it's getting this signal randomly.

On Fri, May 10, 2019, 3:09 AM walkor [email protected] wrote:

Just a log, please ignore it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/walkor/phpsocket.io/issues/193#issuecomment-491200029, or mute the thread https://github.com/notifications/unsubscribe-auth/AA5T6QN55PZGSTQDB3VPUUDPUUUUZANCNFSM4HLYSP6Q .

tolew1 avatar May 10 '19 13:05 tolew1

When client side call the function socket.close() or socket.disconnect() the server will get the disconnect packet and show the log. So it seems not a problem.

walkor avatar May 11 '19 02:05 walkor

Thanks for the reply. However it's not getting called. That is the issue. I've tried it using Android and IOS and I can replicate the problem with both. So I don't think it's a client issue. Is there anything that can simulate a close connection? Like a php error or actions etc? Because when a particular emit happens to the server from a device the others in the room get disconnected but not the sender. Not sure what's going on.

On Fri, May 10, 2019 at 9:55 PM walkor [email protected] wrote:

When client side call the function socket.close() or socket.disconnect() the server will get the disconnect packet and show the log. So it seems not a problem.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/walkor/phpsocket.io/issues/193#issuecomment-491473732, or mute the thread https://github.com/notifications/unsubscribe-auth/AA5T6QIFNPMI4XOPBK2KXXDPUYYTFANCNFSM4HLYSP6Q .

tolew1 avatar May 11 '19 03:05 tolew1

var socket = io('...');
socket.on('connect', function(){
   socket.close();
});

The codes will simulate a close connection for javascript. I can not tell you why your Android and IOS client send a close package may be something incompatible with phpsocket.io .

walkor avatar May 11 '19 03:05 walkor

I have this same issue. Sever receive disconnected, bug client still send message, and sever don't any message

songlipeng2003 avatar Sep 12 '19 09:09 songlipeng2003

The reason of this issue is my server code have bug, so server auto disconnect client. I fix my code, it will be ok. @tolew1 you maybe check you code。

songlipeng2003 avatar Sep 12 '19 10:09 songlipeng2003