IPCNotifyState.cs 809 B

12345678910111213141516171819202122232425262728293031323334
  1. using System.Collections.Concurrent;
  2. using H.Pipes;
  3. using InABox.Core;
  4. namespace InABox.IPC
  5. {
  6. public class IPCPushState
  7. {
  8. public class Session
  9. {
  10. public PipeConnection<IPCMessage?> Connection { get; }
  11. public Guid SessionID { get; }
  12. public Platform Platform { get; }
  13. public Session(PipeConnection<IPCMessage?> connection, Guid sessionID, Platform platform)
  14. {
  15. Connection = connection;
  16. SessionID = sessionID;
  17. Platform = platform;
  18. }
  19. }
  20. public ConcurrentDictionary<Guid, Session> SessionMap = new();
  21. public event IPCPollEvent? OnPoll;
  22. public void Poll(Session session)
  23. {
  24. OnPoll?.Invoke(session);
  25. }
  26. }
  27. }