Connection to database not closing

I'm using "redis-rs" for rust and I tested sending a few thousand requests locally and it works really well at the few first, except that at some point it stops accepting requests and starts showing me this error when I send a command to redis:

"Only one usage of each socket address (protocol/network address/port) is normally permitted"

I am opening a client and a connection on every request to the http server that takes them in, that's probably a bad idea in the first place, but shouldn't the connections stop existing and close after the function that opened it ends?

Is there any better solution, like some kind of global connection?


Read more here:

Content Attribution

This content was originally published by at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: