/// <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"))); } }
protected bool Equals(User other) { return Equals(_ipAddress, other._ipAddress) && string.Equals(Name, other.Name); }