DanmakuR.Connection.Kestrel 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package DanmakuR.Connection.Kestrel --version 1.0.0
NuGet\Install-Package DanmakuR.Connection.Kestrel -Version 1.0.0
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="DanmakuR.Connection.Kestrel" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DanmakuR.Connection.Kestrel --version 1.0.0
#r "nuget: DanmakuR.Connection.Kestrel, 1.0.0"
#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.
// Install DanmakuR.Connection.Kestrel as a Cake Addin
#addin nuget:?package=DanmakuR.Connection.Kestrel&version=1.0.0

// Install DanmakuR.Connection.Kestrel as a Cake Tool
#tool nuget:?package=DanmakuR.Connection.Kestrel&version=1.0.0

DanmakuR

通过HubConnection连接到b站直播间弹幕信息流,传输方式可以是WebsocketTCP之一。

快速上手

// 1. 创建`HubConnenction`    

using DanmakuR;

var connBuilder = new BLiveHubConnectionBuilder();

connBuilder.UseWebsocketTransport()
	.WithRoomid(2233);// 基本用法

HubConnection connection = connBuilder.Build();

// 2. 响应事件
// Listener.cs
class Listener : IDanmakuSource
{
	public async Task OnMessageJsonDocumentAsync(string messageName, JsonDocument message)
	{
		switch (messageName)
		{
			// ...
		}

	}

	public async Task OnPopularityAsync(int popularity)
	{
		// 气人值
	}
}

// 3. 绑定监听器并启动连接
listener.BindToConnection(connection);
await connection.StartAsync();

TCP连接?

目前,建立TCP连接需要ASP.NET Core的Kestrel(Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketConnectionFactory类),也就是说只能在ASP.NET Core服务器上用。

那维护呢

随缘

Product Compatible and additional computed target framework versions.
.NET 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.0.1 419 9/26/2022
1.0.0 362 9/25/2022