public bool IsConnected()
 {
     if (client != null)
     {
         return(client.IsConnectionOpen());
     }
     return(false);
 }