Receiving events seems to be unreliable #1300
Replies: 8 comments 4 replies
-
This is what I have installed in the Python environment.
|
Beta Was this translation helpful? Give feedback.
-
I saw that there's an updated version of python-socketio. I've just updated to |
Beta Was this translation helpful? Give feedback.
-
The difference between option 1 and option 2 is that in option 1 you are disconnecting and in option 2 you aren't. The disconnect call interrupts the work that happens in the background to send events. The You should consider using acknowledgements for your emitted events. The easiest way is to switch from If you use |
Beta Was this translation helpful? Give feedback.
-
Absolutely awesome. Thanks for your super quick response. Do you have any idea why I'm still seeing Thanks again. |
Beta Was this translation helpful? Give feedback.
-
To be specific, here is the complete client output:
|
Beta Was this translation helpful? Give feedback.
-
Hey, just stumbled upon this thread. Want to let you know that you are not alone. I am getting this same error. I could be wrong, but I am pretty sure the "Unexpected error decoding packet: "Invalid empty packet received", aborting" message has to do with ping errors. Here is my code:
And the output during the error is
If I change pingTimeout and pingInterval to be less, then the error message happens on the 2nd ping. Maybe you can try it out. If anyone finds a solution I will be eternally grateful. I will keep working on it as well. |
Beta Was this translation helpful? Give feedback.
-
@miguelgrinberg Thanks greatly for having a look at this. I attempted to test out the change you made. I ran:
This upgraded the package to version 4.8.2. However I still see the same message: Perhaps the code changes haven't made it to pip's archive? Or were you wanting us to install from the GitHub repo? The updated client code I ran was:
The full output of running the test in pytest:
|
Beta Was this translation helpful? Give feedback.
-
That worked for me. I installed
And rather than seeing the previous error, I now see Thanks again for looking into this. The full output was:
|
Beta Was this translation helpful? Give feedback.
-
I've most likely done something wrong and would love assistance please. Thanks in advance.
I have both a client and server written using python-socketio, with the server running under Tornado and the client running under
pytest
.When I ran the client, the server saw 3 events out of 10 trials.
When I ran the client with a
wait()
call (i.e. option 1 is uncommented), I see no major change, 2 events received out of 10 trials.When I add a
time.sleep()
call (i.e. option 2 is uncommented), I see 10 events received out of 10 trials. In other words, things seem to be working fine.However, irrespective of whether the server receives the event, I also regularly see errors reported in the client, for example
Unexpected error decoding packet: "Invalid empty packet received", aborting
after it tries to disconnect.Below is the code for both the client and server.
Client:
Server:
Beta Was this translation helpful? Give feedback.
All reactions