Skip to content

Conversation

tkyc
Copy link
Contributor

@tkyc tkyc commented Jun 20, 2023

Adds new localSocketAddress connection string property. Valid values are IPv4/IPv6 addresses or a hostname.

#2146

@Jeffery-Wasty Jeffery-Wasty linked an issue Jun 21, 2023 that may be closed by this pull request
@Jeffery-Wasty Jeffery-Wasty added this to the 12.5.0 milestone Jun 21, 2023
@lilgreenbird lilgreenbird removed this from the 12.5.0 milestone Sep 22, 2023
String localSocketAddress = this.conn.activeConnectionProperties.getProperty(SQLServerDriverStringProperty.LOCAL_SOCKET_ADDRESS.toString());

if (null != localSocketAddress && !localSocketAddress.isEmpty()) {
selectedSocket.bind(new InetSocketAddress(InetAddress.getByName(localSocketAddress), 0));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we validate this user specified loicalSocketAddress as a valid IP somewhere before coming here ? If not would it be good to handle an exception thrown by InetSocketAddress/bind call and raise an error in that case ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

[FEATURE REQUEST] provide localSocketAddress property
4 participants