Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stirlinglabs/sockaddr.net
Provides cross-platform socket address bindings for .Net
https://github.com/stirlinglabs/sockaddr.net
dotnet sockaddr
Last synced: about 12 hours ago
JSON representation
Provides cross-platform socket address bindings for .Net
- Host: GitHub
- URL: https://github.com/stirlinglabs/sockaddr.net
- Owner: StirlingLabs
- License: mit
- Created: 2022-02-15T20:59:33.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-05T09:16:24.000Z (about 2 years ago)
- Last Synced: 2024-11-05T14:07:25.971Z (15 days ago)
- Topics: dotnet, sockaddr
- Language: C#
- Homepage:
- Size: 349 KB
- Stars: 0
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
![StirlingLabs.sockaddr.Net](https://raw.githubusercontent.com/StirlingLabs/sockaddr.Net/main/sockaddr-dotnet.jpg)
> [libsa](https://github.com/StirlingLabs/libsa) provides cross-platform socket address bindings in C11, designed to be very portable and easy to use. This allows higher-level network code to use a single format but still communicate effectively with low-level native platform code.
StirlingLabs.sockaddr.Net provides all of [libsa](https://github.com/StirlingLabs/libsa)'s functionality within .Net, avoiding additional memory allocations wherever possible. It provides an opaque sockaddr* type that is purely pointers or off-gc-heap refs, such that it can be simply cast to/from any other opaque sockaddr* type.
So addresses from any application or API that uses native bindings can be simply cast to StirlingLabs.sockaddr* and then can be manipulated and read without concern for the underlying platform format, then can simply be cast back when being passed back to the application API.
### Why reinvent the wheel?
`sockaddr` isn't going to change once it exists on a platform, so it makes sense to just make a dedicated binding and interop library that can be used anywhere.
### Usage
Configure [GitHub Packages](https://github.com/StirlingLabs/Logging/blob/master/docs/GitHubPackages.md), then you can just:
```shell
dotnet add PROJECT package StirlingLabs.sockaddr.Net
```or just use NuGet however you would normally.
### Support
Development of this project is supported by [Stirling Labs](https://stirlinglabs.github.io).