This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Add TCPKeepAlive to SqlClient Sockets #33024
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5ba6be8
Updating version files
dotnet-maestro[bot] d627a21
Enable keep alive on SqlClient TCP sockets
AfsanehR-zz 22a310a
Merge branch 'master' of https://github.com/dotnet/corefx into TCPKee…
AfsanehR-zz d149a2f
Merge branch 'master' of https://github.com/dotnet/corefx into TCPKee…
AfsanehR-zz f7467b0
make KeepAlive netcoreapp specific
AfsanehR-zz 73c4a57
added condition for uapassembly
AfsanehR-zz b2c4a9b
added a new defineConstants called FEATURE_TCPKEEPALIVE
AfsanehR-zz f4519f3
update TCPKeepAliveInterval value
AfsanehR-zz 261eb30
set KeepAlive values in unix only
AfsanehR-zz 3a5b18a
add documentation and add link to Github Issue
AfsanehR-zz 9bf5e5f
move SNITcpHandle.Windows.cs available in UAP
AfsanehR-zz b9cd903
updating csproj for SNITcpHandle
AfsanehR-zz e2b2f6e
fix in csproj for CI failure
AfsanehR-zz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/System.Data.SqlClient/src/System/Data/SqlClient/SNI/SNITcpHandle.Unix.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Net.Sockets; | ||
using System.Text; | ||
|
||
namespace System.Data.SqlClient.SNI | ||
{ | ||
internal partial class SNITcpHandle | ||
{ | ||
internal static void SetKeepAliveValues(ref Socket socket) | ||
{ | ||
#if FEATURE_TCPKEEPALIVE | ||
socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true); | ||
socket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveInterval, 1); | ||
socket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveTime, 30); | ||
#endif | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/System.Data.SqlClient/src/System/Data/SqlClient/SNI/SNITcpHandle.Windows.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Net.Sockets; | ||
using System.Text; | ||
|
||
namespace System.Data.SqlClient.SNI | ||
{ | ||
internal partial class SNITcpHandle | ||
{ | ||
internal static void SetKeepAliveValues(ref Socket socket) | ||
{ | ||
//This method will later be setting the KeepAlive, TcpKeepAliveInterval and TcpKeepAliveTime based on Windows platform specific checks. | ||
// Link to issue: https://github.com/dotnet/corefx/issues/33209 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment in the function saying why it has been left blank. Possible add the link to the issue, that we discussed should be opened.