Kreisverkehr.NetSsdp
0.1.2
dotnet add package Kreisverkehr.NetSsdp --version 0.1.2
NuGet\Install-Package Kreisverkehr.NetSsdp -Version 0.1.2
<PackageReference Include="Kreisverkehr.NetSsdp" Version="0.1.2" />
<PackageVersion Include="Kreisverkehr.NetSsdp" Version="0.1.2" />
<PackageReference Include="Kreisverkehr.NetSsdp" />
paket add Kreisverkehr.NetSsdp --version 0.1.2
#r "nuget: Kreisverkehr.NetSsdp, 0.1.2"
#:package Kreisverkehr.NetSsdp@0.1.2
#addin nuget:?package=Kreisverkehr.NetSsdp&version=0.1.2
#tool nuget:?package=Kreisverkehr.NetSsdp&version=0.1.2
NetSsdp
NetSsdp is a small .NET library for working with Simple Service Discovery Protocol (SSDP). It provides a lightweight client for sending SSDP search requests, receiving responses and notifications, and parsing SSDP messages.
Features
- Discover SSDP devices and services using
SsdpClient.DiscoverAsync - Send SSDP messages with
SsdpClient.SendMessageAsync - Receive SSDP events via
SsdpClient.MessageReceived - Parse raw SSDP messages with
SsdpMessage.Parse - Dependency injection support through
AddSsdp()extension method
Requirements
- .NET 10.0 SDK
Getting started
Build the library
From the repository root:
dotnet build src\NetSsdp\NetSsdp.csproj
Using the library
You can create an SsdpClient directly:
using Kreisverkehr.NetSsdp;
using var client = new SsdpClient();
await foreach (var response in client.DiscoverAsync())
{
Console.WriteLine(response.UniqueServiceName);
}
To receive SSDP notifications and messages:
client.MessageReceived += (sender, args) =>
{
Console.WriteLine(args.Message);
};
For dependency injection support, add SSDP services to your IServiceCollection:
services.AddLogging();
services.AddSsdp();
var client = provider.GetRequiredService<ISsdpClient>();
await client.RunDiscoveryAsync("ssdp:all");
Parsing raw SSDP messages
Use SsdpMessage.Parse to convert raw SSDP text into a message object:
var message = SsdpMessage.Parse(Encoding.UTF8.GetBytes(rawSsdpResponse));
Samples
See Samples/Readme.md for descriptions and usage of the included sample programs.
Project structure
src/NetSsdp/- library source codeSamples/- sample programs demonstrating discovery, message reception, and parsing
Notes
The library currently targets .NET 10.0.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Microsoft.Extensions.Hosting (>= 10.0.12)
- Microsoft.Extensions.Logging (>= 10.0.12)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Kreisverkehr.NetSsdp:
| Package | Downloads |
|---|---|
|
Kreisverkehr.NetUpnp
NetUpnp is a small .NET library for working with Universal Plug and Play (UPnP). |
GitHub repositories
This package is not used by any popular GitHub repositories.