IService.cs 460 B

123456789101112131415161718192021222324
  1. using System;
  2. using System.Threading.Tasks;
  3. namespace Network
  4. {
  5. public interface IService: IDisposable
  6. {
  7. /// <summary>
  8. /// 将函数调用加入IService线程
  9. /// </summary>
  10. /// <param name="action"></param>
  11. void Add(Action action);
  12. Task<IChannel> GetChannel(string host, int port);
  13. Task<IChannel> GetChannel(string address);
  14. Task<IChannel> GetChannel();
  15. void Remove(IChannel channel);
  16. void Start();
  17. }
  18. }