/// <summary>
        /// Executes the UDP request.
        /// </summary>
        /// <param name="uri">The URI.</param>
        /// <param name="message">The message.</param>
        /// <returns>
        /// The tracker response message.
        /// </returns>
        private TrackerMessage ExecuteUdpRequest(Uri uri, TrackerMessage message)
        {
            uri.CannotBeNull();
            message.CannotBeNull();

            byte[]       data = null;
            IAsyncResult asyncResult;
            IPEndPoint   any = new IPEndPoint(IPAddress.Any, this.ListeningPort);

            try
            {
                using (UdpClient udp = new UdpClient())
                {
                    udp.Client.SendTimeout    = (int)TimeSpan.FromSeconds(5).TotalMilliseconds;
                    udp.Client.ReceiveTimeout = (int)TimeSpan.FromSeconds(15).TotalMilliseconds;

                    if (this.TrackerUri.Port > 0)
                    {
                        udp.Send(message.Encode(), message.Length, this.TrackerUri.Host, this.TrackerUri.Port);
                    }
                    else
                    {
                        return(null);
                    }

                    asyncResult = udp.BeginReceive(null, null);

                    if (asyncResult.AsyncWaitHandle.WaitOne(TimeSpan.FromSeconds(5)))
                    {
                        data = udp.EndReceive(asyncResult, ref any);
                    }
                    else
                    {
                        // timeout
                    }
                }
            }
            catch (SocketException ex)
            {
                Debug.WriteLine($"could not send message to UDP tracker {this.TrackerUri} for torrent {this.TorrentInfoHash}: {ex.Message}");

                return(null);
            }

            if (TrackerMessage.TryDecode(data, 0, MessageType.Response, out message))
            {
                if (message is ErrorMessage)
                {
                    Debug.WriteLine($"error message received from UDP tracker {this.TrackerUri}: \"{message.As<ErrorMessage>().ErrorText}\"");
                }

                return(message);
            }
            else
            {
                return(null);
            }
        }