Ejemplo n.º 1
0
 /// <summary>
 /// Send message async
 /// </summary>
 /// <param name="addresseeUser"></param>
 /// <param name="message"></param>
 /// <returns></returns>
 public async Task SendMessage(User addresseeUser, Message message)
 {
     var bf = new BinaryFormatter();
     using (var memoryStream = new MemoryStream())
     {
         bf.Serialize(memoryStream, message);
         await _udpClient.SendAsync(memoryStream.ToArray(), Convert.ToInt32(memoryStream.Length),
             new IPEndPoint(addresseeUser.IpAddress, GetIntParamFromConfig("RemotePort")));
     }
 }
Ejemplo n.º 2
0
 protected bool Equals(User other)
 {
     return Equals(_ipAddress, other._ipAddress) && string.Equals(Name, other.Name);
 }