예제 #1
0
        static void Main(string[] args)
        {
            /*
             * Soket nesnesini oluşturuyoruz
             * her Do metodunu çalıştırdığımızda farklı işlemler çalışacaktır.
             */
            Soket s = new Soket(8080);

            s.Do();
            s.Do();
            s.Do();
            Console.ReadKey();
        }
예제 #2
0
 public void Handle(Soket s)
 {
     Console.WriteLine("{0} Port soket Kapatıldı.", s.Port);
     /*Context birdahaki çalışmasında SoketStateAc nesnesine göre çalışacak*/
     s.State = new SoketStateAc();
 }
예제 #3
0
 public void Handle(Soket s)
 {
     Console.WriteLine("{0} Port soket Dinleniyor.", s.Port);
     /*Context birdahaki çalışmasında SoketStateKapat nesnesine göre çalışacak*/
     s.State = new SoketStateKapat();
 }