예제 #1
0
        private void Disconnect(String[] tab)
        {
            int          id = Convert.ToInt32(tab[1]);
            int          snnpA, f1;
            ModelControl s = Locate(id);

            if (!s.id.Equals("0"))                            // czyli ze znalazl, to dzialaj
            {
                snnpA = Convert.ToInt32(Locate(id).snnpA);
                f1    = Convert.ToInt32(Locate(id).f1I);
                kom.Disconnect(snnpA, f1);
                communicationT.Send_Text(ProtokolControl.DISCONN_R + " " + id, Network.outputControl);
            }
            else
            {
                communicationT.Send_Text(ProtokolControl.DISCONN_F + " " + id, Network.outputControl);
            }
        }
예제 #2
0
        private void Disconnect()
        {
            int portIn, portOut, f1;

            portIn  = Convert.ToInt32(command[9].Substring(0, 1));
            portOut = Convert.ToInt32(command[9].Substring(1, 1));
            f1      = Convert.ToInt32(command[9].Substring(2, 1));


            if (connections > 0)
            {
                kom.Disconnect(portIn, f1);
                communicationT.Send_Text(Protokol.DISCON_R, Network.outputControl);
                connections--;
            }
            else
            {
                communicationT.Send_Text(Protokol.ERR, Network.outputControl);
            }

            Console.WriteLine("ilosc polaczen: " + connections);
        }