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