Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

localSocketAddress implementation #2152

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

localSocketAddress implementation #2152

wants to merge 2 commits into from

Conversation

tkyc
Copy link
Member

@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));

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