private static void DefaultConnection() { try { Console.WriteLine("Connecting to robot"); conn = new RobotConnection(Constants.RobotIpAddress, Constants.RobotPort); if (DEBUG) { DebugStartChat(); } } catch (Exception e) { Console.WriteLine("Failed to automaticly connect to robot"); ManualConnect(); } }
private static void ManualConnect() { try { string Ip = Console.ReadLine(); Console.WriteLine("Enter Port: "); int Port; while (!int.TryParse(Console.ReadLine(), out Port)) { Console.WriteLine("Enter Port: "); } conn = new RobotConnection(Ip, Port); if (DEBUG) { DebugStartChat(); } } catch (Exception e) { Console.WriteLine(e.Message); ManualConnect(); Console.WriteLine("Failed to connect to robot"); } }