AService.cs 683 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Net.Sockets;
  5. using System.Threading.Tasks;
  6. namespace Base
  7. {
  8. public enum NetworkProtocol
  9. {
  10. TCP,
  11. UDP
  12. }
  13. public abstract class AService: IDisposable
  14. {
  15. /// <summary>
  16. /// 将函数调用加入IService线程
  17. /// </summary>
  18. /// <param name="action"></param>
  19. public abstract void Add(Action action);
  20. public abstract AChannel GetChannel(long id);
  21. public abstract Task<AChannel> AcceptChannel();
  22. public abstract AChannel ConnectChannel(string host, int port);
  23. public abstract void Remove(long channelId);
  24. public abstract void Update();
  25. public abstract void Dispose();
  26. }
  27. }