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

Make use of .NET 6 new socket API such as cancelation token support #160

Closed
lextm opened this issue Aug 22, 2021 · 4 comments
Closed

Make use of .NET 6 new socket API such as cancelation token support #160

lextm opened this issue Aug 22, 2021 · 4 comments

Comments

@lextm
Copy link
Collaborator

lextm commented Aug 22, 2021

.NET 6 finally introduces new socket API such as Socket.SendToAsync with cancelation token support,

https://docs.microsoft.com/en-us/dotnet/api/system.net.sockets.socket.sendtoasync?view=net-6.0#System_Net_Sockets_Socket_SendToAsync_System_ReadOnlyMemory_System_Byte__System_Net_Sockets_SocketFlags_System_Net_EndPoint_System_Threading_CancellationToken_

#SNMP Library can added new methods to adapt to such changes.

#140 is only one of the scenarios.

@zivillian
Copy link
Contributor

zivillian commented Sep 14, 2021

I've created a first draft of an implementation which should work on all supported platforms.

zivillian@6c71154

The SocketExtension implementation can later be made platform dependent to use the native implementation for net6.

What do you think? Should I complete the implementation and add the remaining overloads and CancellationToken parameter?

@lextm
Copy link
Collaborator Author

lextm commented Sep 14, 2021

@zivillian It looks nice, and I start to wonder if we should ship the newly implemented methods in a separate library (NuGet package). The benefit of a separate package is that we can explicitly mark it as .NET 6 and above only (instead of adding conditional compilation in the current library).

@lextm
Copy link
Collaborator Author

lextm commented Dec 1, 2021

@lextm
Copy link
Collaborator Author

lextm commented Jan 9, 2022

Implemented in recent commits.

@lextm lextm closed this as completed Jan 9, 2022
@lextm lextm removed the in progress label Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants