Esempio n. 1
0
        protected void NewLink(Link link)
        {
            // clone to be able to edit original list
            List<Link> temp = new List<Link>(links);

            foreach (Link l in temp)
            {
                if (l.Address == link.Address)
                {
                    l.Stop();
                }
            }

            link.Disconnected += Link_Disconnected;
            links.Add(link);
            link.Start();
            Trace.WriteLine(
                "New link at " + link.Address);
        }
Esempio n. 2
0
        public void Post(Link from, string data)
        {
            Trace.WriteLine("Received from " + from.Address + ": " + data);

            IResponse response = CommandProcessor.Process(data);
            from.Send(response);
        }