Is your feature request related to a problem? If so, please give a short summary of the problem and how the feature would resolve it
Currently, when using a custom socket factory that returns a connected socket, a SocketException is thrown because the getConnectedSocket method in IOBuffer.java will attempt to connect without checking whether the socket is already connected.
Describe the preferred solution
Check whether a socket is connected before attempting to connect to it in getConnectedSocket. See the corresponding code in the Postgres JDBC driver for reference
Additional context
This small change would allow for compatibility with the Cloud SQL JDBC Socket Factory.
Is your feature request related to a problem? If so, please give a short summary of the problem and how the feature would resolve it
Currently, when using a custom socket factory that returns a connected socket, a
SocketExceptionis thrown because thegetConnectedSocketmethod inIOBuffer.javawill attempt to connect without checking whether the socket is already connected.Describe the preferred solution
Check whether a socket is connected before attempting to connect to it in
getConnectedSocket. See the corresponding code in the Postgres JDBC driver for referenceAdditional context
This small change would allow for compatibility with the Cloud SQL JDBC Socket Factory.