/// <summary> /// /// </summary> /// <param name="remoteEP"></param> /// <param name="data"></param> public ChatServerDataReceiveEventArgs(IPEndPoint remoteEP, byte[] data) { this.RemoteEP = remoteEP; this.Data = data; this.MessageType = MessagePackageBase.GetMessageType(data); }
/// <summary> /// 发送消息广播 /// </summary> /// <param name="message"></param> /// <returns></returns> private void SendMessage(MessagePackageBase message) { byte[] data = message.GetPackageData(); this.Client.Send(data, data.Length, ChatClient.ServerAddress); }