JsonRPC/templates/CSharp/JRpcTransport.cs

16 lines
397 B
C#
Raw Normal View History

using System.Threading.Tasks;
namespace __NAMESPACE__;
public delegate void NotifyPacket(string data);
public abstract class JRpcTransport {
2022-01-11 08:47:35 +00:00
public event NotifyPacket? OnPacket;
public abstract Task Write(string data);
2022-01-10 14:08:38 +00:00
// TODO: Spend some time finding a better permission, but it is fine for now
public void SendPacketEvent(string data) {
2022-01-11 08:47:35 +00:00
this.OnPacket?.Invoke(data);
}
}