mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-04-21 07:16:34 +08:00
重新设计了Libray.Json Api以及 WebSocket 的交互处理方式
This commit is contained in:
37
Serein.Proto.WebSocket/TestClass.cs
Normal file
37
Serein.Proto.WebSocket/TestClass.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
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("");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user