mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-03 00:00:49 +08:00
38 lines
897 B
C#
38 lines
897 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Serein.Proto.WebSocket
|
|
{
|
|
|
|
public class ClassA : ISocketHandleModule
|
|
{
|
|
|
|
}
|
|
public class ClassB : ISocketHandleModule
|
|
{
|
|
|
|
}
|
|
public class ClassC : ISocketHandleModule
|
|
{
|
|
|
|
}
|
|
internal class TestClass
|
|
{
|
|
public void Run()
|
|
{
|
|
SereinWebSocketService sereinWebSocketService = new SereinWebSocketService();
|
|
sereinWebSocketService.AddHandleModule<ClassA>();
|
|
sereinWebSocketService.AddHandleModule<ClassB>(() => new ClassB());
|
|
sereinWebSocketService.TrackUnhandledExceptions(OnExceptionTrackingAsync);
|
|
}
|
|
|
|
private static async Task OnExceptionTrackingAsync(Exception ex, Func<object, Task> SendAsync)
|
|
{
|
|
await SendAsync("");
|
|
}
|
|
}
|
|
}
|