ultramysql icon indicating copy to clipboard operation
ultramysql copied to clipboard

Close and delete the socket if connect() fails

Open filipsalo opened this issue 10 years ago • 0 comments

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.

filipsalo avatar Jan 16 '15 22:01 filipsalo