C# – Ping one remote server from another remote server

c

It's simple to ping a server in C#, but suppose I have servers A, B and C.

A connects to B.

A asks B to ping C, to check that B can talk to C.

A needs to read the outcome.

Now, first of all is this possible without installing an application onto B? In other words, can I perform the entire check from just running a program on A?

If so, can anyone suggest the route I would take to achieve this? I've looked at sockets but from the examples I've seen these require a client AND server application to function.

Best Answer

First of all, this sounds like something that you shouldn't be trying to do.

For example, if you have some application on A that calls B which in turn calls C, then it shouldn't be the responsibility of A to figure out why isn't B working. Simply call B and if it doesn't work, then it doesn't work.

Now, if you really want to do this, you would need some service on B that forwards the request to C (or something like that). If you don't want to install anything on B, then the only way is to (ab)use some service that's already installed on it. But I can't think of any common service that would allow you to do this.