Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Close and delete the socket if connect() fails #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

filipsalomonsson
Copy link

After a failed connect(), is_connected() oddly returns True, and a query() will attempt to write to the socket, even though that's hardly going to work at that point.

Attempting a second connect() raises umysql.Error(0, "Socket already connected"), but after that, is_connected() returns False again, and we're back where we started.

I'm basically a blind monkey banging away at the C++ typewriter here, but my best guess was to close and delete the socket when connect() fails. It doesn't seem to have caused a global thermonuclear war. Yet.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant