None of these are called if there is an error in the connection (one of the `return` statements above) or if an exception is thrown. We're C++ code, we need to use RAII.