Skip to content

Commit 83e2c64

Browse files
Fix | Fix TCP Keep Alive missing call (#854)
1 parent 699ae37 commit 83e2c64

File tree

1 file changed

+4
-0
lines changed
  • src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI

1 file changed

+4
-0
lines changed

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNITcpHandle.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,10 @@ void Cancel()
364364
if (ipAddresses[i] != null)
365365
{
366366
sockets[i] = new Socket(ipAddresses[i].AddressFamily, SocketType.Stream, ProtocolType.Tcp);
367+
368+
// enable keep-alive on socket
369+
SetKeepAliveValues(ref sockets[i]);
370+
367371
sockets[i].Connect(ipAddresses[i], port);
368372
if (sockets[i] != null) // sockets[i] can be null if cancel callback is executed during connect()
369373
{

0 commit comments

Comments
 (0)