Ejemplo n.º 1
0
        public static void ConnectToServer(string address, int port)
        {
            try
            {
                ConnectThread?.Wait(1000);

                Disconnect("Started a new connection");

                ConnectThread = SystemBase.TaskFactory.StartNew(() => ConnectToServer($"{address}:{port}"));
            }
            catch (Exception e)
            {
                LunaLog.LogError($"[LMP]: Error calling the connect thread {e}");
            }
        }
Ejemplo n.º 2
0
        public static void ConnectToServer(string address, int port)
        {
            try
            {
                ConnectThread?.Wait(1000);

                Disconnect("Started a new connection");

                ConnectThread = new Task(() => ConnectToServer($"{address}:{port}"));
                ConnectThread.Start(TaskScheduler.Default);
            }
            catch (Exception e)
            {
                LunaLog.LogError($"[LMP]: Error calling the connect thread {e}");
            }
        }