bchavez / RethinkDb.Driver

:headphones: A NoSQL C#/.NET RethinkDB database driver with 100% ReQL API coverage.

Home Page:http://rethinkdb.com/api/java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix NotSupportedException when connecting to an IPv6 address

gjhommersom opened this issue · comments

When the driver tries to connect to a IPv6 address a NotSupportedException is throw. This occurs because the address family is fixed to IPv4. It should be possible to use the address family of the address to fix this issue.

Line 119 of SocketWrapper.cs
Existing:
var s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
Desired:
var s = new Socket(address.AddressFamily, SocketType.Stream, ProtocolType.Tcp)

Version: 2.3.15.0
OS: Windows 10
.Net Framework: 4.5.2

Hi @gjhommersom , thanks for the bug report.

v2.3.18-beta-1 should resolve your issue.

I think this Socket(AddressFamily,.. change was originally part of #62 reported by @ThomasHoest where he had an issue connecting to a service on Azure.

@ThomasHoest, if you get a chance, could you check v2.3.18-beta-1 to make sure we didn't break your app with the change?

I'll take the beta tag off once we have this change bake 🍪 in the wild for a few.

Thanks again for reporting the issue.
Brian

🏖️ 🎺 Beach Boys - Good Vibrations (Nick Warren bootleg)