public void HandleHTTP(object e) { INetworkUtillity util = new NetworkUtillity((TcpClient) e); string rec = util.Receive(); if(TCPDebug.DEBUG) {Console.WriteLine("New message recieved on TCP.");} IRespondStrategy respondStrategy = Strat.GetStrategy(rec); respondStrategy.Respond(util); }
/// <summary> /// Actually send to the control point /// </summary> /// <param name="e"></param> private void SendEventMsg(object e) { Object[] g = (object[]) e; Subscriber sub = (Subscriber)g[0]; TcpClient p = new TcpClient(); p.Connect(sub.ipep); Console.WriteLine("IP Endpoint for events: " + sub.ipep.Address.ToString()); INetworkUtillity util = new NetworkUtillity(p); util.Send ((string)g[1]); Console.WriteLine("Event msg sent to CP"); //string answer = util.Receive(); //Console.WriteLine("Anwser from CP: " + answer); //util.Close(); }