public void Close()
 {
     ListeningToConnection = false;
     if (connection != null && connection.Connected)
     {
         connection.Close();
     }
     MiddleManAPI.CloseLobby();
 }
Exemple #2
0
 public void Close()
 {
     ListeningToConnection = false;
     if (connection != null && connection.Connected)
     {
         SendMessage("DISCONNECT|");
         connection.Close();
     }
     MiddleManAPI.LeaveLobby();
 }
        public static void AttemptReconnect()
        {
            int attempts = 0;

            while (!MiddleManAPI.Connect() && attempts++ < 10)
            {
                Close();
            }

            // raise can't connect to server
        }