Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server receiving broken data #6

Closed
lancezhaozai opened this issue May 19, 2021 · 3 comments
Closed

server receiving broken data #6

lancezhaozai opened this issue May 19, 2021 · 3 comments
Labels
question Further information is requested

Comments

@lancezhaozai
Copy link

i used the flask-sock to receive a long message from client, its about a string with 2568 characters, it works sometime, the message received successfully, sometimes it broken with no error, i checked all the sending and receiving, i am sure that the message received was broken, do I have to increase the buffer size? or increase the data receiving size? or what should I do?

its easy to simulate the problem, its put in a super large size of string and keep sending and receiving, the error will will not raise but you will found out the string received was shorten

@miguelgrinberg
Copy link
Owner

I'm unable to reproduce this. I'm sending 2568 characters at a rate of 10 times/sec to the example server in this repo and every package is received with the correct length, and the reflected package also arrives at the client with the correct length.

Do you want to provide a complete example that I can use to reproduce the problem that you are seeing?

@miguelgrinberg miguelgrinberg added the question Further information is requested label May 22, 2021
@lancezhaozai
Copy link
Author

lancezhaozai commented May 22, 2021 via email

@louking
Copy link

louking commented Aug 21, 2023

FWIW, I'm seeing (short) messages dropped at the flask-sock server. See louking/tm-csv-connector#15. I'm not sure if this is a different problem. If so I can create a separate issue.

I'm running a flask-sock application on python 3.10, using gunicorn, behind nginx. It appears the nginx server receives all the websockets messages but the gunicorn / flask server misses some. I tried increasing the number of gunicorn threads and workers, but that didn't help.

The source for all this is at https://github.com/louking/tm-csv-connector/tree/e114036e6c024eaae4ad1d26f68788655b45b11b

The docker build requires a bunch of javascript files external to the repo. The files are expected to be in static/js as indicated by https://github.com/louking/tm-csv-connector/blob/e114036e6c024eaae4ad1d26f68788655b45b11b/app/src/tm_csv_connector/assets.py

The docker app (websocket server) is started by docker compose -f docker-compose.yml -f docker-compose.dev.yml up --build -d. The external (windows) app (websocket client) is started by python -m tm-reader-client.app

Note the tm-reader-client app is expecting an external device for input. This would have to be modified to just generate test messages.

Also some config files are required for the docker app to work. I can discuss offline somehow if you're interested in pursuing.

Similar to @lancezhaozai, due to time constraints I'm going to investigate flask-socketio, but since I came here I thought I'd give you a full implementation which is dropping messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants