socket.io-client-dart
socket.io-client-dart copied to clipboard
Slow and sometimes disconnect by itself
Hi,
socket_io_client: ^2.0.0-beta.3 && 2.0.0-beta.3-nullsafety.0 Im using flutter 2.0.4
I notice connection sometime disconnect by it self and reconnect again. This happened at random. And i notice when i send request to nodejs server, it receive immediately, but from nodejs server response back to flutter. it is very slow. less than 1 sec to request. receive response 7-10 seconds.
IO.Socket socket = IO.io('https://api.domain.com', <String, dynamic>{ 'secure': true, 'forceNew': true, 'autoConnect': true, 'path': '/sio/socket.io', 'timeout': 30000, 'reconnect': true, 'transports': <String>['websocket', 'xhr-polling'] });
Nodejs socket.io, I have tested ver 4.0.1, 4.0.0 and 3.1.2 Its all the same.
me too
any solution to fix it?
+1
I manage to speed up receiving data at client by JSON.stringify(dataToSend) it first. Before the client is receiving object(Map) or array(List). the bigger the data in object/array, the slower the client to process.
But after I stringify the data, I noticed quite significant less time for the client to receive and display the data. Hope this helps.
I'm still monitoring random disconnect. Hope this is related.