예제 #1
0
 /// <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);
 }
예제 #2
0
 /// <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);
 }