IClientChannel.cs 1006 B

123456789101112131415161718192021222324252627282930
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace Taobao.Top.Link.Channel
  5. {
  6. /// <summary>the channel that client connect to server
  7. /// </summary>
  8. public interface IClientChannel : IChannelSender
  9. {
  10. /// <summary>while message received on this channel
  11. /// </summary>
  12. EventHandler<ChannelContext> OnMessage { get; set; }
  13. /// <summary>while error occur on this channel
  14. /// </summary>
  15. EventHandler<ChannelContext> OnError { get; set; }
  16. /// <summary>while channel was closed by given reason
  17. /// </summary>
  18. EventHandler<ChannelClosedEventArgs> OnClosed { get; set; }
  19. /// <summary>get or set remote uri
  20. /// </summary>
  21. Uri Uri { get; set; }
  22. /// <summary>weather the channel is valid
  23. /// </summary>
  24. bool IsConnected { get; }
  25. /// <summary>timer for heartbeat if set
  26. /// </summary>
  27. ResetableTimer HeartbeatTimer { set; }
  28. }
  29. }