/// <summary> /// 构造函数。 /// </summary> /// <param name="source"></param> /// <param name="messge"></param> public Answer(MSGKind source, string messge) { this.Kind = MSGKind.Answer; this.SourceKind = source; this.Message = messge; }
/// <summary> /// 构造函数。 /// </summary> /// <param name="source"></param> public Answer(MSGKind source) : this(source, string.Empty) { }
/// <summary> /// 发送应答数据给客户端。 /// </summary> /// <param name="netWorkStream"></param> /// <param name="sendkind"></param> /// <param name="message"></param> protected virtual void SendAnswer(NetworkStream netWorkStream, MSGKind sendkind, string message) { Answer answer = new Answer(sendkind, message); answer.Time = DateTime.Now; this.SendData(netWorkStream, answer, message); }