-
-
Notifications
You must be signed in to change notification settings - Fork 588
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
How to close a client? #227
Comments
How do you disconnect? If you are calling the |
I tried calling the
|
You can't call disconnect in the connect handler, the connection isn't established yet at that point. Return |
I solved my problem by calling |
@davidkingzyb FYI I was having a problem in my application's unit tests where after I called |
Maybe the old version has this problem. This bug should have been fixed at v3.0.1 #228, now |
Hmm, I'm using v3.1.2 and was experiencing the |
Hmm I am facing the exact same problem....things I tried so far:
using
I want to close the connection and finish execution of the program once the server finishes a computation and sends the finish msg, or when the server says the client is outdated. |
@neuronflow please share a small, complete example that I can use to see your problem here. |
Hi @miguelgrinberg thanks for the prompt response. I struggle a bit to make a small example, so following the complete code. I try to walk you through it.
On a sidenote:
Is there a more elegant way to do this? For some reason the whole thing stops working then I remove the wait command, I suspect this might also be the culprit while the program does not return. Thanks for taking the time, please let me know if you require further information. the code:
|
Unfortunately I cannot test this code. The only comment I have is that you are stopping your docker container before you disconnect, I think it should be the other way around. But overall, I don't really see the benefit of using a client/server architecture or Socket.IO in this case, since you have one client and one server, and you run the server just to process one unit of work from the client and then stop it. |
Thank you so much, that was it! So apparently trying to end a connection that does not exist anymore like in my case never returns. some background info about this project: I made the python socket-io client to integrate preprocessing capabilities of the server in pipelines and to automate testing of it...How would you implement the interaction between frontend and dockered backend if not with websockets? :) |
Well, if you force me to use electron plus a docker backend then you aren't leaving me much choice. For a desktop application I would have implemented a desktop app, maybe all in Python using pyside or wxpython, neither electron nor docker would have been a first choice for me. |
Ahh that was my initial plan to, but the software packages several gigabytes of binaries for brain preprocessing which only run on Linux and I found it very hard to package them reliably in a cross platform app. I also appreciate the complex form validation possibilities in web technology. So overall the docker / electron route seemed to be the path of least resistance. |
Hello,
I use flask-socketio and python-socketio[client].
After I disconnect from the client the script is still runing and ping pong with the server.
How to close the client?
The text was updated successfully, but these errors were encountered: