Skip to content

Commit 2ec5e1b

Browse files
RobertTheArchitectcincuranet
authored andcommitted
Keeping address family (fix for IPv6)
1 parent ab15a4a commit 2ec5e1b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Provider/src/FirebirdSql.Data.FirebirdClient/Client/Managed/GdsConnection.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,15 @@ public virtual void Connect()
115115
IPAddress = GetIPAddress(_dataSource, AddressFamily.InterNetwork);
116116
var endPoint = new IPEndPoint(IPAddress, _portNumber);
117117

118-
_socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
118+
//Changed by Robert Dickens @RobertTheArchitect on Oct-04-2017 as
119+
//Existing code bellow will fail connection when attempting to remotly connect to a
120+
//Remote Firebird installation via IPv6 protocol only
121+
//_socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
122+
123+
124+
//Address family being passed into Socket should reflect the AddressFamily of the IpAddress Object and not
125+
//forced to InterNetwork creating a protocol conflict
126+
_socket = new Socket(IPAddress.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
119127

120128
_socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer, _packetSize);
121129
_socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendBuffer, _packetSize);

0 commit comments

Comments
 (0)