3

I created a startup command and already off the firewall using below:

netsh advfirewall set allprofiles state off

My object is to communicate our server from our application which already hosted as a Azure cloud service.

Initially i want to execute the below code:

            Ping pingSender = new Ping();
            PingOptions options = new PingOptions();

            // Use the default Ttl value which is 128, 
            // but change the fragmentation behavior.
            options.DontFragment = true;

            // Create a buffer of 32 bytes of data to be transmitted. 
            string data = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
            byte[] buffer = Encoding.ASCII.GetBytes(data);
            int timeout = 120000;
            PingReply reply = pingSender.Send(this.txtAddress.Text, timeout, buffer, options);
            if (reply.Status == IPStatus.Success)
            {
                lblStatus.Text += string.Format("Address: {0} <BR />", reply.Address.ToString());
                lblStatus.Text += string.Format("RoundTrip time: {0} <BR />", reply.RoundtripTime);
                lblStatus.Text += string.Format("Time to live: {0} <BR />", reply.Options.Ttl);
                lblStatus.Text += string.Format("Don't fragment: {0} <BR />", reply.Options.DontFragment);
                lblStatus.Text += string.Format("Buffer size: {0} <BR />", reply.Buffer.Length);
            }
            else
            {
                lblStatus.Text = string.Format("Error executing ping on {0}, status : {1}", txtAddress.Text, reply.Status);
            }
        }
        catch (Exception exception)
        {
            lblStatus.Text = exception.Message;
        }

But i always get a timout. Not any successful ping.

I am just stuck on it and any help would be highly appreciated. Thanks

  • Ping microsoft.com. Does that work? – usr Feb 17 '15 at 14:21
  • The server that hosts your website has to be configured to respond to icmp pings. They aren't, and they won't be. Your question should be "I need to achieve X, I attempted using ping for this task but Azure website servers don't respond to ping requests. How else can I accomplish this?" –  Feb 17 '15 at 15:40
  • Guys, I already checked this problem. From Azure, it can't be able send ping request to any server outside. Thanks for your feedback – Arif uzzaman Feb 26 '15 at 13:55

0 Answers0