Files
serein-flow/Library/Network/WebSocket/SocketControlBase.cs
fengjiayi d1b9a3f28f 使用emit代替表达式树构造委托。
内置了websocket server与相应的导航功能,可在实例工程中找到相应的实现。
2024-10-10 10:45:53 +08:00

42 lines
1.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using Serein.Library.Attributes;
using System;
using System.Collections.Generic;
using System.Net.WebSockets;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace Serein.Library.Network.WebSocketCommunication
{
public interface ISocketControlBase
{
Guid HandleGuid { get; }
}
//[AutoRegister(RegisterSequence.FlowLoading)]
//[AutoSocketModule(JsonThemeField = "theme", JsonDataField = "data")]
//public class UserService : ISocketControlBase
//{
// public Guid HandleGuid { get; } = new Guid();
// // Action<string> 类型是特殊的,会用一个委托代替,这个委托可以将文本信息发送到客户端
// // Action<object> 类型是特殊的会用一个委托代替这个委托可以将对象转成json发送到客户端
// [AutoSocketHandle]
// public void AddUser(User user,Action<string> Recover)
// {
// Console.WriteLine(user.ToString());
// Recover("ok");
// }
// [AutoSocketHandle(ThemeValue = "Remote")]
// public void DeleteUser(User user, Action<string> Recover)
// {
// Console.WriteLine(user.ToString());
// }
//}
}