IService.cs 490 B

1234567891011121314151617181920212223242526
  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 RunOnce(int timeout);
  17. void Run();
  18. }
  19. }