static void Main(String[] args) { String clientName; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Clientix c = new Clientix(); if (args != null) { try { clientName = args[0]; c.readConfig(clientName); c.connect = true; } catch {} } Application.Run(c); }
Clientix parent; //coby móc krozystać z routelist i metod #endregion Fields #region Constructors public eLReMix(Clientix nod) { parent = nod; adresLRM = nod.myAddress.ToString(); Address temp = Address.Parse(adresLRM); temp.host = 0; adresRC = temp.ToString(); temp.host = 1; adresCC = temp.ToString(); kolejkapyt = new ConcurrentQueue<Packet.ATMPacket>(); kolejkaodp = new List<Packet.ATMPacket>(); kolejkaS = new ConcurrentQueue<SPacket>(); atm = new Thread(new ThreadStart(ATMReader)); atm.IsBackground = true; atm.Start(); s = new Thread(new ThreadStart(SReader)); s.IsBackground = true; s.Start(); //logowanie wyslijSPacket(new SPacket(adresLRM, adresRC, "HELLO " + adresLRM));//logowanie do RC wyslijSPacket(new SPacket(adresLRM, adresCC, "HELLO " + adresLRM));//logowanie do RC }
String adresLRM, adresRC, adresCC; //lokalne kopie, coby nie szukać za długo public eLReMix(Clientix nod) { parent = nod; adresLRM = nod.myAddress.ToString(); Address temp = Address.Parse(adresLRM); temp.host = 0; adresRC = temp.ToString(); temp.host = 1; adresCC = temp.ToString(); kolejkapyt = new ConcurrentQueue <Packet.ATMPacket>(); kolejkaodp = new List <Packet.ATMPacket>(); kolejkaS = new ConcurrentQueue <SPacket>(); atm = new Thread(new ThreadStart(ATMReader)); atm.IsBackground = true; atm.Start(); s = new Thread(new ThreadStart(SReader)); s.IsBackground = true; s.Start(); //logowanie wyslijSPacket(new SPacket(adresLRM, adresRC, "HELLO " + adresLRM)); //logowanie do RC wyslijSPacket(new SPacket(adresLRM, adresCC, "HELLO " + adresLRM)); //logowanie do RC }
public Agentix(Clientix parent) { this.parent = parent; netstream = new NetworkStream(parent.managerSocket); read = new StreamReader(netstream); write = new StreamWriter(netstream); sendLoginC = false; sendCall = false; sendDisconnect = false; sendGetClients = false; whoIsCalled = ""; whoToDisconnect = ""; writeThread = new Thread(writer); readThread = new Thread(reader); }