Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8893275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:12:15+00:00 2026-06-14T23:12:15+00:00

I have C# based client-server architecture. The client will connect to server and exchange

  • 0

I have C# based client-server architecture. The client will connect to server and exchange data.

I need to check the server status continuously and if the server goes down (removed from the network or shut down) the client needs to indicate that.

If I am using Ping utility in the client program, which will be the best method in terms of performance i.e, monitor via a separate thread or through a background class?

public static bool GetPingResponse(string IpAddress, int timeout = 3000)
{
    var ping = new Ping();
    var reply = ping.Send(IpAddress, timeout); 
    if (reply.Status == IPStatus.Success)
    {
        return true;
    }
    else
    {
        return false;
    }
}

Is there any other option better than Ping in terms of performance and consuming the resource?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T23:12:16+00:00Added an answer on June 14, 2026 at 11:12 pm

    You’ll want to make sure your call is representative of “being available”. For example, if it’s an http server, making a ping request just says it’s reachable via the network. The web server could be down but the network stack is up. If that’s the case, make a call to something that exercises more of the stack like http. If there’s backend databases, the call could go through to the database server. It all depends on your definition of “available”. If the point is to say the application is available, you should look into a call that exercises a path through the full stack.

    It also depends on what the server has available and what’s open via firewalls between the clients and the servers.

    Ping uses ICMP which some sites choose to block via firewalls. If that’s open, it’s a cheap call with little overhead.

    If that’s blocked and it’s a web server for example over http, you could have a cheap endpoint on the web server that you could call via http client in C#.

    You’ll want to poll on a background thread probably with a timer. Look into the BackgroundWorker class or ThreadPool.QueueUserWorkitem.

    Finally, you could look into a monitoring solution – there’s many out there which could monitor multiple facets of your server(s). If you go that route, the client could simply query the monitoring solution which might be better since you wouldn’t have n clients polling your servers – just one monitoring stack.

    On a side note, the last block of code can be simplified down to:

    return reply.Status == IPStatus.Success;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have client server based app which saves user related data into a zip
Background: I have written a java swing based client server application. The server is
I am developing a TcpClient/TcpListener based client-server application. Now I have come to the
We have what I think is a fairly typical client/server architecture, with a frontend
I have existing video streaming application which is based client server technlogy. Existing system
For learning purposes I am writing a socket based client/server application. I have designed
For learning purposes I am writing a socket based client/server application. I have designed
We have a Java based client/server project. Recently one of the testers has found
We have a product built on the Client-Server architecture. Some details about the technology
I have a client server based windows forms application that needs an administrator only

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.