NativeSockets2 1.0.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package NativeSockets2 --version 1.0.5
                    
NuGet\Install-Package NativeSockets2 -Version 1.0.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NativeSockets2" Version="1.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NativeSockets2" Version="1.0.5" />
                    
Directory.Packages.props
<PackageReference Include="NativeSockets2" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NativeSockets2 --version 1.0.5
                    
#r "nuget: NativeSockets2, 1.0.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NativeSockets2@1.0.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NativeSockets2&version=1.0.5
                    
Install as a Cake Addin
#tool nuget:?package=NativeSockets2&version=1.0.5
                    
Install as a Cake Tool

NativeSockets2

A P/Invoke wrapper over a native C UDP socket library, providing the same API as NativeSockets with a native backend.

NuGet


About

  • NativeSockets2 is a lightweight, cross‑platform library for UDP networking.
  • It is a P/Invoke wrapper around a native C library, delivering high performance through a native implementation.
  • The library exposes the exact same public API as NativeSockets, making it a drop‑in replacement.
  • Precompiled native binaries are included for all supported platforms and architectures.

Supported Platforms

  • Windows
  • Linux
  • macOS
  • iOS
  • Android
  • FreeBSD
  • tvOS
  • watchOS
  • visionOS

Key Features

  • Zero garbage collection pressure
  • Same API as NativeSockets – seamless switching between managed and native backends.
  • Complete UDP support – create, bind, connect, send, receive, and poll sockets.
  • Ipv4 and Ipv6 with dual‑mode support.
  • Allocation‑free extension methods for System.Net.Sockets.Socket:
    • SendToNonAlloc – send data without temporary allocations.
    • ReceiveFromNonAlloc – receive data and capture the remote endpoint without allocations.
  • Scatter/gather I/O – Efficient vectored send and receive operations.
  • Host name resolution and reverse lookups – Resolve names to addresses and back, all without allocations.

Native Library Dependency

  • The NuGet package includes the native C library for all supported platforms.
  • The correct binary is loaded automatically at runtime – no extra installation or configuration is needed.
  • Just add the package and use the same API as you would with the original NativeSockets.
  • You can build binaries using GitHub Actions.
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

  • net10.0

    • No dependencies.
  • net5.0

    • No dependencies.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.7 51 9/9/2026
1.1.6 33 9/9/2026
1.1.5 58 9/8/2026
1.1.4 77 9/8/2026
1.1.3 73 9/8/2026
1.1.2 78 9/4/2026
1.1.1 85 9/3/2026
1.1.0 79 9/2/2026
1.0.9 77 9/2/2026
1.0.8 84 9/1/2026
1.0.7 81 9/1/2026
1.0.6 75 9/1/2026
1.0.5 88 9/1/2026
1.0.4 85 9/1/2026
1.0.3 88 8/31/2026
1.0.2 109 8/31/2026
1.0.1 91 8/30/2026
1.0.0 98 8/30/2026