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

Feature | Add SqlDataSourceEnumerator #1430

Merged
merged 36 commits into from Mar 9, 2022

Conversation

Kaur-Parminder
Copy link
Contributor

@Kaur-Parminder Kaur-Parminder commented Dec 13, 2021

Added UDP Broadcast to SSRP

Details about Request/Response/timeouts are available in specification

Update:

  • Ports Native code System.Data.Sql
  • Added Native and Managed Helper for parsing enumeration results from SNI and Managed SSRP respectively.
  • Integrated the Managed and Native Implementation using AppContext condition to switch to choose one.
  • This PR will remain in Draft because this requires updated SNI package to build which will be released earlier before merging this PR.
  • Added Unit Test

Added UDP Broadcast to SSRP
@Kaur-Parminder Kaur-Parminder added the Ⓜ️ Managed SNI Use this label if the issue/PR relates to issues in Managed SNI label Dec 13, 2021
…Native and Managed)

Added SqlDataSourceEnumerator Public API and AppContext for Helpers (Native and Managed)
@Kaur-Parminder Kaur-Parminder marked this pull request as draft December 21, 2021 17:55
@Kaur-Parminder Kaur-Parminder changed the title Managed Implementation for SqlDataSourceEnumerator: Phase 1 Implementation for SqlDataSourceEnumerator: Managed, Native Dec 21, 2021
Added AppContext change to unit test
@DavoudEshtehari DavoudEshtehari added this to the 5.0.0-preview1 milestone Feb 3, 2022
@DavoudEshtehari DavoudEshtehari changed the title Implementation for SqlDataSourceEnumerator: Managed, Native Feature | Add SqlDataSourceEnumerator Feb 3, 2022
# Conflicts:
#	src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/AdapterUtil.cs
#	src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj
@Kaur-Parminder Kaur-Parminder added 🆕 Public API Use this label for new API additions to the driver. and removed Ⓜ️ Managed SNI Use this label if the issue/PR relates to issues in Managed SNI 📄 Native SNI labels Feb 7, 2022
Copy link
Member

@DavoudEshtehari DavoudEshtehari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the record:

  • Sanitize your code by considering the warning and messages in the Error List.
  • Include traces using EventSource as much as possible?
  • Add documentation for the public APIs.
  • Include the new public APIs in ref files.
  • Add inline comments with reference.

license
exclude appcontext test
Comments and url references
review comment
fix strbuilder overwrite
VS Suggestions
body expression for GetTimeoutSeconds
created util for sqldatasourceenumerator
more utils
license for util file
@Kaur-Parminder Kaur-Parminder marked this pull request as ready for review March 4, 2022 19:33
Comment on lines 28 to 38
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIServerEnumOpenWrapper")]
internal static extern IntPtr SNIServerEnumOpen();

[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIServerEnumCloseWrapper")]
internal static extern void SNIServerEnumClose([In] IntPtr packet);

[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIServerEnumReadWrapper", CharSet = CharSet.Unicode)]
internal static extern int SNIServerEnumRead([In] IntPtr packet,
[In][MarshalAs(UnmanagedType.LPArray)] char[] readBuffer,
[In] int bufferLength,
[MarshalAs(UnmanagedType.Bool)] out bool more);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines should be moved into SNINativeMethodWrapper.Windows.cs. And modify the native helper accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🆕 Public API Use this label for new API additions to the driver.
Projects
SqlClient issues
Awaiting triage
Development

Successfully merging this pull request may close these issues.

None yet

4 participants