private static void CloseSocket()
 {
     try
     {
         Client.CloseSocket();
     }
     catch (Exception e)
     {
         Logger.WriteLine("Error closing socket: " + e.ToString(), Logger.LOG_LEVEL.ERROR);
     }
 }