Haukcode.Network
1.1.30
dotnet add package Haukcode.Network --version 1.1.30
NuGet\Install-Package Haukcode.Network -Version 1.1.30
<PackageReference Include="Haukcode.Network" Version="1.1.30" />
<PackageVersion Include="Haukcode.Network" Version="1.1.30" />
<PackageReference Include="Haukcode.Network" />
paket add Haukcode.Network --version 1.1.30
#r "nuget: Haukcode.Network, 1.1.30"
#:package Haukcode.Network@1.1.30
#addin nuget:?package=Haukcode.Network&version=1.1.30
#tool nuget:?package=Haukcode.Network&version=1.1.30
Haukcode.Network
A .NET library providing common network utilities and efficient binary I/O operations for network programming.
Quick Start
Installation
dotnet add package Haukcode.Network
Features
- Network Adapter Discovery - Query network interfaces, IP addresses, and MAC addresses
- Binary I/O - Efficient big-endian and little-endian binary readers/writers
- Network Utilities - Multicast addresses, broadcast addresses, socket configuration
Usage Examples
Get Network Adapters
using Haukcode.Network;
// Get first available IP address
var (ipAddress, netMask, macAddress) = Utils.GetFirstBindAddress();
// Get all adapters
var adapters = Utils.GetCommonAdapters();
foreach (var adapter in adapters)
{
Console.WriteLine($"{adapter.DisplayName}: {adapter.AllIpv4Addresses[0].IP}");
}
Binary I/O (Network Byte Order)
using Haukcode.Network;
// Write binary data
var buffer = new byte[1024];
var writer = new BigEndianBinaryWriter(buffer);
writer.WriteUInt16(0x1234);
writer.WriteUInt32(0x12345678);
writer.WriteString("Hello", 10);
// Read binary data
var reader = new BigEndianBinaryReader(buffer);
ushort value16 = reader.ReadUInt16();
uint value32 = reader.ReadUInt32();
string text = reader.ReadString(10);
Network Utilities
using Haukcode.Network;
using System.Net;
// Generate multicast address
IPAddress multicast = Utils.GetMulticastAddress(1); // 239.255.0.1
// Calculate broadcast address
IPAddress broadcast = Utils.GetBroadcastAddress(
IPAddress.Parse("192.168.1.100"),
IPAddress.Parse("255.255.255.0")); // 192.168.1.255
// Configure socket
var socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
Utils.SetSocketOptions(socket);
Key APIs
Network Utilities:
Utils.GetCommonAdapters()- Get ethernet and WiFi adaptersUtils.GetFirstBindAddress()- Get first available IP addressUtils.GetMulticastAddress(universeId)- Generate multicast addressUtils.GetBroadcastAddress(ip, netmask)- Calculate broadcast addressUtils.SetSocketOptions(socket)- Configure socket options
Binary I/O:
BigEndianBinaryReader/BigEndianBinaryWriter- Network byte orderLittleEndianBinaryReader/LittleEndianBinaryWriter- Little-endian- Supports: Int16, UInt16, Int32, UInt32, bytes, strings, GUIDs
- Memory-efficient with
Memory<T>andSpan<T>
Documentation
For complete documentation, examples, and API reference, visit: https://github.com/HakanL/Haukcode.Network
License
MIT License - Copyright (c) 2024 Hakan Lindestaf
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 was computed. 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 was computed. 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 was computed. 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 was computed. 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. |
-
.NETStandard 2.1
- No dependencies.
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Haukcode.Network:
| Package | Downloads |
|---|---|
|
Haukcode.ArtNet
ArtNet library for .NET Core (.NET8+) |
|
|
Haukcode.sACN
A simple sACN library for .NET Core |
|
|
Haukcode.KiNet
A simple KiNet library for .NET Core |
|
|
Haukcode.SigNet
A Sig-Net (secure CoAP-based DMX512 over IP) library for .NET: Sender role and receive-only Node role |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.30 | 92 | 10/21/2026 |
| 1.0.29 | 2,461 | 7/3/2026 |
| 1.0.28 | 132 | 7/3/2026 |
| 1.0.27 | 1,274 | 3/12/2026 |
| 1.0.26 | 2,125 | 2/5/2026 |
| 1.0.22 | 2,037 | 12/13/2024 |
| 1.0.21 | 188 | 12/13/2024 |
| 1.0.20 | 204 | 12/12/2024 |
| 1.0.19 | 211 | 12/12/2024 |
| 1.0.18 | 219 | 12/12/2024 |
| 1.0.17 | 197 | 12/12/2024 |
| 1.0.16 | 288 | 12/12/2024 |
| 1.0.15 | 198 | 12/12/2024 |
| 1.0.14 | 205 | 12/12/2024 |
| 1.0.13 | 209 | 12/12/2024 |
| 1.0.12 | 281 | 12/9/2024 |
| 1.0.11 | 207 | 12/8/2024 |
| 1.0.10 | 476 | 5/22/2024 |
| 1.0.9 | 240 | 5/22/2024 |
| 1.0.8 | 234 | 5/22/2024 |