Example #1
0
        public void Disconnected()
        {
            try
            {
                if (LV != null)
                {
                    if (Program.form1.listView1.InvokeRequired)
                    {
                        Program.form1.listView1.BeginInvoke((MethodInvoker)(() =>
                        {
                            LV.Remove();
                        }));
                    }
                    lock (Settings.Online)
                        Settings.Online.Remove(this);
                }
            }
            catch { }

            try
            {
                if (ClientSocket.Connected)
                {
                    ClientSocket.Shutdown(SocketShutdown.Both);
                }
            }
            catch { }

            try
            {
                ClientSocket?.Dispose();
                ClientMS?.Dispose();
            }
            catch { }
        }
Example #2
0
        public void Disconnected()
        {
            if (LV != null)
            {
                Program.form1.BeginInvoke((MethodInvoker)(() =>
                {
                    try
                    {
                        lock (Settings.LockListviewClients)
                            LV.Remove();

                        if (LV2 != null)
                        {
                            lock (Settings.LockListviewThumb)
                                LV2.Remove();
                        }
                    }
                    catch { }
                }));
                new HandleLogs().Addmsg($"Client {TcpClient.RemoteEndPoint.ToString().Split(':')[0]} disconnected", Color.Red);
            }

            try
            {
                SslClient?.Dispose();
                TcpClient?.Dispose();
                ClientMS?.Dispose();
            }
            catch { }
        }
Example #3
0
        public void Disconnected()
        {
            if (LV != null)
            {
                Program.form1.Invoke((MethodInvoker)(() =>
                {
                    try
                    {
                        lock (Settings.LockListviewClients)
                            LV.Remove();

                        if (LV2 != null)
                        {
                            lock (Settings.LockListviewThumb)
                                LV2.Remove();
                        }
                    }
                    catch { }
                    SoundPlayer sp = new SoundPlayer(Server.Properties.Resources.offline);
                    sp.Load();
                    sp.Play();
                    new HandleLogs().Addmsg($"Client {Ip} disconnected.", Color.Red);
                }));
            }

            try
            {
                SslClient?.Dispose();
                TcpClient?.Dispose();
            }
            catch { }
        }
Example #4
0
        public void Disconnected()
        {
            if (LV != null)
            {
                Program.form1.Invoke((MethodInvoker)(() =>
                {
                    try
                    {
                        lock (Settings.LockListviewClients)
                            LV.Remove();

                        if (LV2 != null)
                        {
                            lock (Settings.LockListviewThumb)
                                LV2.Remove();
                        }
                    }
                    catch { }
                    new HandleLogs().Addmsg($"Client {Ip} disconnected", Color.Red);
                }));
            }

            try
            {
                SslClient?.Dispose();
                TcpClient?.Dispose();
            }
            catch { }
        }
        List <List <int> > CreatedoubleConstraintsBetween3Param(List <Value> LV1, List <Value> LV2, List <Value> LV3)
        {
            List <List <int> > TmpdoubleConstraintsList = CreateSingleConstraintsBetween2Param(LV1, LV2);
            List <List <int> > DoubleConstraintsList    = new List <List <int> >();

            foreach (Value V3 in LV3)
            {
                foreach (List <int> LV in TmpdoubleConstraintsList)
                {
                    LV.Add(V3.Val_id);
                    List <int> TmpLV = new List <int>();
                    TmpLV.AddRange(LV);
                    DoubleConstraintsList.Add(TmpLV);
                    LV.Remove(V3.Val_id);
                }
            }
            return(DoubleConstraintsList);
        }
Example #6
0
        public void Disconnected()
        {
            if (LV != null)
            {
                if (Program.form1.listView1.InvokeRequired)
                {
                    Program.form1.listView1.BeginInvoke((MethodInvoker)(() =>
                    {
                        try
                        {
                            lock (Settings.Listview1Lock)
                                LV.Remove();

                            if (LV2 != null)
                            {
                                lock (Settings.Listview3Lock)
                                    LV2.Remove();
                            }
                        }
                        catch { }
                    }));
                }

                lock (Settings.Online)
                    Settings.Online.Remove(this);
            }

            try
            {
                TcpClient.Shutdown(SocketShutdown.Both);
            }
            catch { }

            try
            {
                SslClient?.Close();
                TcpClient?.Close();
                SslClient?.Dispose();
                TcpClient?.Dispose();
                ClientMS?.Dispose();
            }
            catch { }
        }
Example #7
0
        public void Disconnected()
        {
            if (LV != null)
            {
                Program.form1.Invoke((MethodInvoker)(() =>
                {
                    try
                    {
                        lock (Settings.LockListviewClients)
                            LV.Remove();

                        if (LV2 != null)
                        {
                            lock (Settings.LockListviewThumb)
                                LV2.Remove();
                        }
                    }
                    catch { }
                    new HandleLogs().Addmsg($"Client {Ip} disconnected.", Color.Red);
                    TimeZoneInfo local = TimeZoneInfo.Local;
                    if (local.Id == "China Standard Time" && Properties.Settings.Default.Notification == true)
                    {
                        SoundPlayer sp = new SoundPlayer(Server.Properties.Resources.offline);
                        sp.Load();
                        sp.Play();
                    }

                    foreach (AsyncTask asyncTask in Form1.getTasks.ToList())
                    {
                        asyncTask.doneClient.Remove(ID);
                    }
                }));
            }

            try
            {
                SslClient?.Dispose();
                TcpClient?.Dispose();
            }
            catch { }
        }
Example #8
0
 public void Disconnected()
 {
     if (LV != null)
     {
         if (Program.form1.listView1.InvokeRequired)
         {
             Program.form1.listView1.BeginInvoke((MethodInvoker)(() =>
             {
                 LV.Remove();
             }));
         }
     }
     Settings.Online.Remove(this);
     try
     {
         MS?.Dispose();
         Client?.Close();
         Client?.Dispose();
     }
     catch { }
 }