title: c# Ping a TCP Client from the server
body: <p>How can a <code>TcpClient</code> be pinged from a server in order to see its response time? I have a <code>TCPServer</code> that I have created with a <code>TCPClientManager</code> that I have also created. This simply adds a new <code>Client</code> with a .NET <code>TcpClient</code> property to a<code>List</code> whenever a client connects. How can I get the address of the <code>TcpClient</code> so that I can ping it using .NET <code>Ping</code> ?</p>
  
  <pre><code>public long PingClient(Client client)
  {
      long pingTime = 0;
      Ping pingSender = new Ping();
  
      // The class Client has a property tcpClient of type TcpClient
      IPAddress address = IPAddress.Parse(Client.tcpClient...???);
      PingReply reply = pingSender.Send(address);
  
      if (reply.Status == IPStatus.Success)
      {
          pingTime = reply.RoundtripTime;
      }
  
      return pingTime;
  }
  </code></pre>