Replies: 1 comment
-
Hi! That's weird indeed. Which client are you using? JS? Are you able to reproduce the issue with a basic project (you can fork our fiddle project)? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
on the client side, I successfully connect to the server and thereafter set up a listener: _chatSocket.on('chatData', (data) async { ... code }). Upon connection, the server executes a function and then emits chatData: socket.emit('chatData', response);
This has been working fine for over 2 years. I implemented a new feature making the response data from the server bigger and more data is processed on the client side. After this update the socket does not receive the data from the server approximately 50% of the time. Immidiately after the client receives data on _chatSocket.on('chatData) I print "getChatData: $data" to the console. But nothing is showing 50% of the time.
The solution has been to make the server wait 1 second before sending chatData. Which is extremely odd.
Why is this? Why is the listener "_chatSocket.on('chatData', (data) ...)" so slow to begin to listen? Is there anyway I can debug this?
EDIT:
I tracked time, my result from the client side (took 1851 - 523 ms ):
Whereas code on the backend side (which had many steps to it) took 30 ms to execute. This is why I have to delay the emit from the server. but why does it take so much time to connect and set up a listener on the client side?
Beta Was this translation helpful? Give feedback.
All reactions