How to maintain long or reuse connection
See original GitHub issueI have been trying to maintain connection btw client and server like heartbeat checkup. When I
run the program for the first time the ping is working in the server with status **** connect
but
after the 1st iteration when the emit function is called but emit is not working with statue **** disconnect
.
# version: 1
from socketio import Client,
ws = Client()
ws.connect(f'http://localhost:5000/')
white True:
ws.emit('to_server', 'Ping')
ws.sleep(5)
Expected Result
I like to invoke recver the message to the server, each time on the iteration on calling emit in client side.
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Reusing backend connections to increase performance - Fastly
Reusing connections between your Varnish instance and your backends (origins) is a good idea for multiple reasons.
Read more >4 Optimizing Universal Connection Pool Behavior
The connection reuse feature allows connections to be gracefully closed and removed from a connection pool after a specific amount of time or...
Read more >Load balancing and scaling long-lived connections in ...
Kubernetes doesn't load balance long-lived connections and some Pods ... HTTP keep-alive, or HTTP connection reuse that uses a single TCP connection to...
Read more >Improve database performance with connection pooling
Instead of opening and closing connections for every request, connection pooling uses a cache of database connections that can be reused ...
Read more >How To Reuse Http Connections In Go - Golang Cafe
In this article we are going to see how it's possible to reuse http Connections In Go and how you can do it....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sorry about that. Thanq for your time.
As I said above, you are disconnecting after you send each event. Your actual code is different than the snippets you are showing me here. You have a try/except/finally, and you are disconnecting in the finally clause.